Skip to content

Commit

Permalink
process-submissions: don't fail on empty db
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Sep 10, 2024
1 parent bf2826d commit 3c19ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/process_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def main(dojob_nthreads, dosub_nthreads, refresh_rate, max_sub_retries,
lastsubs = []
lastjobs = []

first_maxui = UserImage.objects.aggregate(Max('id'))['id__max']
first_maxui = UserImage.objects.aggregate(Max('id'))['id__max'] or 0
print('Maximum UserImage id on startup:', first_maxui)
n_jobs_done = 0

Expand All @@ -880,7 +880,7 @@ def main(dojob_nthreads, dosub_nthreads, refresh_rate, max_sub_retries,
if newsubs.count():
print('Found', newsubs.count(), 'unstarted Submissions:', [s.id for s in newsubs])

maxui = UserImage.objects.aggregate(Max('id'))['id__max']
maxui = UserImage.objects.aggregate(Max('id'))['id__max'] or 0
print('New UserImages:', maxui-first_maxui, '; Jobs completed:', n_jobs_done)

print('Checking for UserImages without Jobs')
Expand Down

0 comments on commit 3c19ff7

Please sign in to comment.