Skip to content

Commit

Permalink
chg: [crawler] add function to delete schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed May 15, 2024
1 parent 4eb1b01 commit 86f312c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/lib/crawlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
return schedule_uuid

def _delete_schedules():
for schedule_uuid in get_schedulers_uuid():
schedule = CrawlerSchedule(schedule_uuid)
schedule.delete()

# TODO sanityze UUID
def api_delete_schedule(data):
schedule_uuid = data.get('uuid')
Expand Down Expand Up @@ -1673,7 +1678,6 @@ def create_task(url, depth=1, har=True, screenshot=True, header=None, cookiejar=
external=external)
return task_uuid


## -- CRAWLER TASK -- ##

#### CRAWLER TASK API ####
Expand Down

0 comments on commit 86f312c

Please sign in to comment.