代码优化
This commit is contained in:
parent
656da15505
commit
b888ca7943
2
main.py
2
main.py
|
|
@ -173,7 +173,7 @@ async def get_goods_info(task_data: GoodsInfo, task_manager: Any = Depends(get_t
|
|||
print(f"开始处理任务: {task_id}")
|
||||
result = await task_manager.deal_shopee_task(params)
|
||||
if result:
|
||||
printinfo(f"任务处理成功: {task_id}")
|
||||
print(f"任务处理成功: {task_id}")
|
||||
data = {"task_id": params["task_id"], "status": 2}
|
||||
await task_manager.update_task_record(data)
|
||||
return {"code": 200, "message": "数据获取成功", "data": result}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class AllTask:
|
|||
"""
|
||||
处理Shopee任务的异步方法
|
||||
"""
|
||||
key = f"{data['app_name'].lower()}:{data['region'].lower()}:{data['shop_id']}:{data['item_id']}"
|
||||
key = f"{param['app_name'].lower()}:{param['region'].lower()}:{param['shop_id']}:{param['item_id']}"
|
||||
result = self.redis_conn.read_data(key)
|
||||
if result is not None:
|
||||
print(f"{key} 从Redis缓存中获取到数据")
|
||||
|
|
|
|||
Loading…
Reference in New Issue