cron: log and capture exceptions, do not create logged errors (#88783)
gitea/wcs/pipeline/head This commit looks good
Details
gitea/wcs/pipeline/head This commit looks good
Details
This commit is contained in:
parent
dc473b7378
commit
3501733920
|
@ -16,6 +16,7 @@
|
|||
|
||||
import datetime
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
@ -128,4 +129,5 @@ def cron_worker(publisher, since, job_name=None):
|
|||
with job.log_long_job():
|
||||
job.function(publisher, job=job)
|
||||
except Exception as e:
|
||||
publisher.record_error(exception=e, context='[CRON]', notify=True)
|
||||
job.log(f'exception running job {job.name}: {e}')
|
||||
publisher.capture_exception(sys.exc_info())
|
||||
|
|
Loading…
Reference in New Issue