refector: send_mail_task优化

This commit is contained in:
caoqianming 2023-03-31 23:16:40 +08:00
parent f2c02a76d4
commit e32f82ace7
1 changed files with 1 additions and 1 deletions

View File

@ -27,5 +27,5 @@ class CustomTask(Task):
if settings.DEBUG is False:
detail = '{0!r} failed: {1!r}'.format(task_id, exc)
myLogger.error(detail)
send_mail_task.delay(subject='{}:{}_{}_task_error'.format(settings.SYS_NAME, settings.SYS_VERSION, settings.PROJECT_NAME), message=detail)
send_mail_task.delay(subject='task_error', message=detail)
return super().on_failure(exc, task_id, args, kwargs, einfo)