fix: Account backup: when sending to the mailbox fails, the task status also shows the success problem.

pull/16056/head
wangruidong 2025-09-18 14:55:20 +08:00 committed by Bryan
parent 46da05652a
commit c593f91d77
2 changed files with 3 additions and 6 deletions

View File

@ -235,8 +235,8 @@ class AccountBackupHandler:
except Exception as e:
error = str(e)
print(f'\033[31m>>> {error}\033[0m')
self.execution.status = Status.error
self.execution.summary['error'] = error
self.manager.status = Status.error
self.manager.summary['error'] = error
def backup_by_obj_storage(self):
object_id = self.execution.snapshot.get('id')

View File

@ -97,10 +97,7 @@ def send_mail_attachment_async(subject, message, recipient_list, attachment_list
for attachment in attachment_list:
email.attach_file(attachment)
os.remove(attachment)
try:
return email.send()
except Exception as e:
logger.error("Sending mail attachment error: {}".format(e))
return email.send()
@shared_task(