Skip to content

Commit

Permalink
Merge pull request #3413 from rebeccacremona/ia-upload-task-count-tweak
Browse files Browse the repository at this point in the history
Alert if something goes wrong with the Internet Archive task count
  • Loading branch information
rebeccacremona authored Oct 25, 2023
2 parents 79ad0dd + fd29e45 commit c4527d4
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 c4527d4

Please sign in to comment.