feat: 邮件报错频率过高自动屏蔽2
This commit is contained in:
parent
5e905519bf
commit
e8ced88547
|
@ -36,6 +36,7 @@ def send_mail_task(**args):
|
||||||
email_enable = False
|
email_enable = False
|
||||||
# 如果频率高于每分钟4封,则自动屏蔽半小时
|
# 如果频率高于每分钟4封,则自动屏蔽半小时
|
||||||
cache.set(cache_key, (email_count, email_enable), 1800)
|
cache.set(cache_key, (email_count, email_enable), 1800)
|
||||||
|
args['subject'] = args['subject'] + '_发送频繁'
|
||||||
from django.core.mail import send_mail
|
from django.core.mail import send_mail
|
||||||
send_mail(**args)
|
send_mail(**args)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue