Revert "Add salary detection configuration and payloads"
This reverts commit 332b743fa5.
This commit is contained in:
@@ -4,7 +4,6 @@ Configuration settings for the salary analytics package.
|
||||
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
import random
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
@@ -77,21 +76,4 @@ OUTPUT_PATHS = {
|
||||
"inconsistent_model": os.path.join(MODEL_DIR, "inconsistent_model.joblib"),
|
||||
"consistent_scaler": os.path.join(MODEL_DIR, "consistent_scaler.joblib"),
|
||||
"inconsistent_scaler": os.path.join(MODEL_DIR, "inconsistent_scaler.joblib")
|
||||
}
|
||||
|
||||
# Salary Detect Endpoint Config
|
||||
SALARY_DETECT_URL = "http://www.simbrellang.net:5000/autocall/analytic-salary-detect"
|
||||
SALARY_DETECT_HEADERS = {
|
||||
"accept": "/",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
SALARY_DETECT_PAYLOADS = [
|
||||
{"salaryDate": "2022-01-01", "customerId": "CN621868", "accountId": "2017821799", "salaryAmount": 200000},
|
||||
{"customerId": "CUC2268333011", "accountId": "ACC8116931898", "salaryDate": "2025-07-08", "salaryAmount": 200000},
|
||||
{"customerId": "CUC2163677018", "accountId": "ACC8118539484", "salaryDate": "2025-07-08", "salaryAmount": 200000},
|
||||
{"customerId": "CUC1968062010", "accountId": "ACC8115473093", "salaryDate": "2025-07-08", "salaryAmount": 200000},
|
||||
{"customerId": "CUC1302360013", "accountId": "ACC8117628489", "salaryDate": "2025-07-08", "salaryAmount": 200000}
|
||||
]
|
||||
|
||||
def get_random_salary_payload():
|
||||
return [random.choice(SALARY_DETECT_PAYLOADS)]
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
import time
|
||||
import logging
|
||||
import threading
|
||||
import requests
|
||||
from .config import SALARY_DETECT_URL, SALARY_DETECT_HEADERS, get_random_salary_payload
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -15,14 +13,9 @@ class SalaryDetect:
|
||||
def _run(self):
|
||||
while self._running:
|
||||
logger.info(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] Detecting salary...")
|
||||
try:
|
||||
payload = get_random_salary_payload()
|
||||
response = requests.post(SALARY_DETECT_URL, headers=SALARY_DETECT_HEADERS, json=payload)
|
||||
logger.info(f"POST {SALARY_DETECT_URL} status: {response.status_code}, response: {response.text}")
|
||||
except Exception as e:
|
||||
logger.error(f"Error during POST: {e}")
|
||||
time.sleep(1)
|
||||
logger.info(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] Salary detection complete")
|
||||
time.sleep(120)
|
||||
time.sleep(1)
|
||||
|
||||
def start(self):
|
||||
if not self._running:
|
||||
|
||||
Reference in New Issue
Block a user