Skip to content

Commit

Permalink
fixup! Serialize background tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
dbnicholson committed Aug 24, 2023
1 parent 0f3e012 commit 2804d97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kolibri_explore_plugin/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ def enqueue_next_background_task():
"""Locate the next background task and enqueue it for running"""

# If there's already a job in progress, do nothing. We only want a
# single background task running.
# single background task running in order to not slow down the user
# interface and to leave room in the worker pool for user-triggered
# downloads.
#
# https://github.com/endlessm/kolibri-explore-plugin/pull/762
in_progress_jobs = BackgroundTask.objects.exclude(job_id="").exclude(
job_state__in=[State.FAILED, State.CANCELED, State.COMPLETED]
)
Expand Down

0 comments on commit 2804d97

Please sign in to comment.