Skip to content

Commit

Permalink
If something goes wrong with the task count, alert the error log.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccacremona committed Oct 25, 2023
1 parent 79ad0dd commit fd29e45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions perma_web/perma/celery_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2462,6 +2462,10 @@ def conditionally_queue_internet_archive_uploads_for_date_range(start_date_strin
max_to_queue = settings.INTERNET_ARCHIVE_MAX_SIMULTANEOUS_UPLOADS - tasks_in_flight
to_queue = min(max_to_queue, limit) if limit else max_to_queue

if to_queue < 0:
logger.error(f"Something is amiss with the IA upload process: InternetArchiveItem.inflight_task_count ({InternetArchiveItem.inflight_task_count()}) is larger than settings.INTERNET_ARCHIVE_MAX_SIMULTANEOUS_UPLOADS.")
return

if to_queue:

total_queued = 0
Expand Down

0 comments on commit fd29e45

Please sign in to comment.