去除并发, 更改验证码识别密钥不存验证码图片
This commit is contained in:
27
main.py
27
main.py
@@ -23,8 +23,8 @@ def get_task():
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
data = {
|
||||
"include_task_type": [],
|
||||
"exclude_task_type": ["login_account"],
|
||||
"include_task_type": ["login_account"],
|
||||
"exclude_task_type": []
|
||||
}
|
||||
response = requests.post(url, headers=header, json=data)
|
||||
if response.status_code == 200:
|
||||
@@ -61,19 +61,18 @@ def execute_task(tid, task_type, **kwargs):
|
||||
|
||||
|
||||
def main():
|
||||
with ThreadPoolExecutor(max_workers=1) as t:
|
||||
while True:
|
||||
try:
|
||||
task = get_task()
|
||||
if task is None:
|
||||
time.sleep(10)
|
||||
continue
|
||||
task['data']['tid'] = task['id']
|
||||
task['data']['task_type'] = task['task_type']
|
||||
t.submit(execute_task, **task['data'])
|
||||
except Exception as e:
|
||||
error_logger.error(f'Main Error: {e}')
|
||||
while True:
|
||||
try:
|
||||
task = get_task()
|
||||
if task is None:
|
||||
time.sleep(10)
|
||||
continue
|
||||
task['data']['tid'] = task['id']
|
||||
task['data']['task_type'] = task['task_type']
|
||||
execute_task(**task['data'])
|
||||
except Exception as e:
|
||||
error_logger.error(f'Main Error: {e}')
|
||||
time.sleep(10)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user