mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
chg: [crawler] add function to delete schedules
This commit is contained in:
parent
4eb1b01370
commit
86f312cbc3
1 changed files with 5 additions and 1 deletions
|
@ -1286,6 +1286,11 @@ def create_schedule(frequency, user, url, depth=1, har=True, screenshot=True, he
|
||||||
schedule.create(frequency, user, url, depth=depth, har=har, screenshot=screenshot, header=header, cookiejar=cookiejar, proxy=proxy, user_agent=user_agent, tags=tags)
|
schedule.create(frequency, user, url, depth=depth, har=har, screenshot=screenshot, header=header, cookiejar=cookiejar, proxy=proxy, user_agent=user_agent, tags=tags)
|
||||||
return schedule_uuid
|
return schedule_uuid
|
||||||
|
|
||||||
|
def _delete_schedules():
|
||||||
|
for schedule_uuid in get_schedulers_uuid():
|
||||||
|
schedule = CrawlerSchedule(schedule_uuid)
|
||||||
|
schedule.delete()
|
||||||
|
|
||||||
# TODO sanityze UUID
|
# TODO sanityze UUID
|
||||||
def api_delete_schedule(data):
|
def api_delete_schedule(data):
|
||||||
schedule_uuid = data.get('uuid')
|
schedule_uuid = data.get('uuid')
|
||||||
|
@ -1673,7 +1678,6 @@ def create_task(url, depth=1, har=True, screenshot=True, header=None, cookiejar=
|
||||||
external=external)
|
external=external)
|
||||||
return task_uuid
|
return task_uuid
|
||||||
|
|
||||||
|
|
||||||
## -- CRAWLER TASK -- ##
|
## -- CRAWLER TASK -- ##
|
||||||
|
|
||||||
#### CRAWLER TASK API ####
|
#### CRAWLER TASK API ####
|
||||||
|
|
Loading…
Reference in a new issue