Commit 6f39c8d8 by baiquan

refactor(shop): 调整任务日志输出位置

- 将任务日志输出从函数开头调整到判断任务为空之后
- 优化了日志输出的可读性和时机,确保仅在存在任务时才输出任务信息
parent e0f3e9f4
...@@ -186,13 +186,13 @@ async def run(task_type): ...@@ -186,13 +186,13 @@ async def run(task_type):
except Exception as e: except Exception as e:
logger.error(f'获取任务失败 --> {e}') logger.error(f'获取任务失败 --> {e}')
return return
logger.info(json.dumps(tasks))
tasks = tasks.get('data', tasks) tasks = tasks.get('data', tasks)
if type(tasks) == dict: if type(tasks) == dict:
tasks = [tasks] tasks = [tasks]
if not tasks: if not tasks:
logger.debug('没有任务') logger.debug('没有任务')
return return
logger.info(json.dumps(tasks))
# 使用线程池处理所有任务 # 使用线程池处理所有任务
with concurrent.futures.ThreadPoolExecutor(max_workers=OUTER_MAX_WORKERS) as outer_executor: with concurrent.futures.ThreadPoolExecutor(max_workers=OUTER_MAX_WORKERS) as outer_executor:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment