Merge pull request #8634 from adityahase/truncate-unhandled-email
perf(database): Regularly clean old unhandled emails
This commit is contained in:
commit
3dce7ec079
3 changed files with 8 additions and 1 deletions
|
|
@ -8,3 +8,8 @@ from frappe.model.document import Document
|
|||
|
||||
class UnhandledEmail(Document):
|
||||
pass
|
||||
|
||||
|
||||
def remove_old_unhandled_emails():
|
||||
frappe.db.sql("""DELETE FROM `tabUnhandled Email`
|
||||
WHERE creation < %s""", frappe.utils.add_days(frappe.utils.nowdate(), -30))
|
||||
|
|
|
|||
|
|
@ -188,7 +188,8 @@ scheduler_events = {
|
|||
"frappe.social.doctype.energy_point_settings.energy_point_settings.allocate_review_points",
|
||||
"frappe.integrations.doctype.google_contacts.google_contacts.sync",
|
||||
"frappe.automation.doctype.auto_repeat.auto_repeat.make_auto_repeat_entry",
|
||||
"frappe.automation.doctype.auto_repeat.auto_repeat.set_auto_repeat_as_completed"
|
||||
"frappe.automation.doctype.auto_repeat.auto_repeat.set_auto_repeat_as_completed",
|
||||
"frappe.email.doctype.unhandled_email.unhandled_email.remove_old_unhandled_emails"
|
||||
],
|
||||
"daily_long": [
|
||||
"frappe.integrations.doctype.dropbox_settings.dropbox_settings.take_backups_daily",
|
||||
|
|
|
|||
|
|
@ -254,3 +254,4 @@ frappe.patches.v12_0.delete_duplicate_indexes
|
|||
frappe.patches.v12_0.set_default_incoming_email_port
|
||||
frappe.patches.v12_0.update_global_search
|
||||
execute:frappe.reload_doc('desk', 'doctype', 'notification_settings')
|
||||
execute:frappe.email.doctype.unhandled_email.unhandled_email.remove_old_unhandled_emails
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue