Skip to content

Commit

Permalink
Expand number of tasks that are gathered together for events cronjob …
Browse files Browse the repository at this point in the history
…because it failed by timing out today
  • Loading branch information
SamuelmdLow committed Sep 2, 2024
1 parent 27b02d8 commit a754d8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions events/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ async def update_events(request):
await event.asave()

tasks = []

max_at_a_time = 30
tasks.append(asyncio.create_task(Event.objects.phas_scrape()))

wp_apis = [
Expand Down Expand Up @@ -463,7 +463,7 @@ async def update_events(request):
for a in wp_apis:
# Event.objects.wp_events_api_get_type_ids(a['api'], terms) # Uncomment to print the event-type id for types wuth the terms above in their name. Used for categorizing the events
tasks.append(asyncio.create_task(Event.objects.read_wp_events_api(a['name'], a['api'], a['categorize'])))
if len(tasks) >= 15:
if len(tasks) >= max_at_a_time:
await asyncio.gather(*tasks)
tasks = []

Expand Down Expand Up @@ -509,7 +509,7 @@ async def update_events(request):

for f in ical_files:
tasks.append(asyncio.create_task(Event.objects.read_ical(f)))
if len(tasks) >= 15:
if len(tasks) >= max_at_a_time:
await asyncio.gather(*tasks)
tasks = []

Expand Down

0 comments on commit a754d8f

Please sign in to comment.