mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-23 06:37:15 +00:00
fix: [crawler] fix api create_task
This commit is contained in:
parent
a14c0484af
commit
bd2ca4b319
1 changed files with 3 additions and 1 deletions
|
@ -1788,7 +1788,7 @@ def api_add_crawler_capture(data, user_id):
|
||||||
return {'error': 'Invalid task_uuid', 'task_uuid': task_uuid}, 400
|
return {'error': 'Invalid task_uuid', 'task_uuid': task_uuid}, 400
|
||||||
capture_uuid = data.get('capture_uuid')
|
capture_uuid = data.get('capture_uuid')
|
||||||
if not capture_uuid:
|
if not capture_uuid:
|
||||||
return {'error': 'Invalid capture_uuid', 'task_uuid': capture_uuid}, 400
|
return {'error': 'Invalid capture_uuid', 'capture_uuid': capture_uuid}, 400
|
||||||
|
|
||||||
# parent = data.get('parent')
|
# parent = data.get('parent')
|
||||||
|
|
||||||
|
@ -1796,6 +1796,8 @@ def api_add_crawler_capture(data, user_id):
|
||||||
task_uuid = create_task(task['url'], depth=task['depth_limit'], har=task['har'], screenshot=task['screenshot'],
|
task_uuid = create_task(task['url'], depth=task['depth_limit'], har=task['har'], screenshot=task['screenshot'],
|
||||||
proxy=task['proxy'], tags=task['tags'],
|
proxy=task['proxy'], tags=task['tags'],
|
||||||
parent='manual', task_uuid=task_uuid, external=True)
|
parent='manual', task_uuid=task_uuid, external=True)
|
||||||
|
if not task_uuid:
|
||||||
|
return {'error': 'Aborted by Crawler', 'task_uuid': task_uuid, 'capture_uuid': capture_uuid}, 400
|
||||||
task = CrawlerTask(task_uuid)
|
task = CrawlerTask(task_uuid)
|
||||||
create_capture(capture_uuid, task_uuid)
|
create_capture(capture_uuid, task_uuid)
|
||||||
task.start()
|
task.start()
|
||||||
|
|
Loading…
Reference in a new issue