浏览代码

Clear outbox modification (#3628)

* Clear Outbox modification

* Correction of SQL query
version-14
Charles-Henri Decultot 8 年前
committed by Rushabh Mehta
父节点
当前提交
2da4bafa1e
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. +4
    -5
      frappe/email/queue.py

+ 4
- 5
frappe/email/queue.py 查看文件

@@ -475,8 +475,7 @@ def clear_outbox():
frappe.db.sql("""delete from `tabEmail Queue Recipient` where parent in (%s)"""
% ','.join(['%s']*len(email_queues)), tuple(email_queues))

for dt in ("Email Queue", "Email Queue Recipient"):
frappe.db.sql("""
update `tab{0}`
set status='Expired'
where datediff(curdate(), modified) > 7 and status='Not Sent'""".format(dt))
frappe.db.sql("""
update `tabEmail Queue`
set status='Expired'
where datediff(curdate(), modified) > 7 and status='Not Sent' and (send_after is null or send_after < %(now)s)""", { 'now': now_datetime() })

正在加载...
取消
保存