mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-08 02:39:22 +00:00
perf: 异步发送
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from django.conf import settings
|
||||
from django.core.mail import send_mail
|
||||
|
||||
from common.tasks import send_mail_async
|
||||
from .base import BackendBase
|
||||
|
||||
|
||||
@@ -12,7 +11,7 @@ class Email(BackendBase):
|
||||
from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER
|
||||
accounts, __, __ = self.get_accounts(users)
|
||||
subject = (settings.EMAIL_SUBJECT_PREFIX or '') + subject
|
||||
send_mail(subject, message, from_email, accounts, html_message=message)
|
||||
send_mail_async.delay(subject, message, from_email, accounts, html_message=message)
|
||||
|
||||
|
||||
backend = Email
|
||||
|
Reference in New Issue
Block a user