Commit a09f0d67 by baiquan

优化hub浏览器关闭逻辑

parent 252eed86
...@@ -201,12 +201,10 @@ async def run(): ...@@ -201,12 +201,10 @@ async def run():
except Exception as e: except Exception as e:
logger.error(f"任务处理异常: {e}") logger.error(f"任务处理异常: {e}")
for task in tasks: for task in tasks:
if type(task) == dict:
browser_id = task.get("browser_id") browser_id = task.get("browser_id")
if browser_id: if browser_id:
await closeBrowser(browser_id) await closeBrowser(browser_id)
# if task.get("type") == 1:
# await closeAllBrowser()
# break
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -220,7 +220,7 @@ async def get_task(params: dict = None): ...@@ -220,7 +220,7 @@ async def get_task(params: dict = None):
tasks = [] tasks = []
publish_task_data = publish_task.get('data', []) publish_task_data = publish_task.get('data', [])
collection_task_data = collection_task.get('data', []) collection_task_data = collection_task.get('data', [])
tasks.extend(publish_task_data) tasks.append(publish_task_data)
tasks.extend(collection_task_data) tasks.extend(collection_task_data)
collection_task['data'] = tasks collection_task['data'] = tasks
return collection_task return collection_task
......
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