misc: log aborted cron job (#58082)

This commit is contained in:
Frédéric Péters 2021-10-22 10:15:56 +02:00
parent b3c957c071
commit a2534dcff1
1 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,11 @@ class Command(BaseCommand):
if verbosity > 1:
print('cron work on %s' % hostname)
CronJob.log('start')
cron_worker(publisher, now, job_name=options.get('job_name'))
try:
cron_worker(publisher, now, job_name=options.get('job_name'))
except Exception as e:
CronJob.log('aborted (%r)' % e)
raise e
if verbosity > 2:
print('cron end (release lock %s)' % lockfile)
except locket.LockError: