From 6c4473ac8f144255cddd656ba8620d850d5bcff6 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 5 Feb 2015 18:19:44 +0530 Subject: [PATCH] [fix] Notification Count - also catch 'Lock wait timeout exceeded; try restarting transaction' --- .../core/doctype/notification_count/notification_count.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/core/doctype/notification_count/notification_count.py b/frappe/core/doctype/notification_count/notification_count.py index fbb8ae4718..d07df31999 100644 --- a/frappe/core/doctype/notification_count/notification_count.py +++ b/frappe/core/doctype/notification_count/notification_count.py @@ -44,7 +44,7 @@ def get_notifications(): "open_count":result}).insert(ignore_permissions=True) except MySQLdb.OperationalError, e: - if e.args[0] != 1213: + if e.args[0] not in (1213, 1205): raise logger.error("Deadlock") @@ -60,7 +60,7 @@ def get_notifications(): "open_count":open_count_module[m]}).insert(ignore_permissions=True) except MySQLdb.OperationalError, e: - if e.args[0] != 1213: + if e.args[0] not in (1213, 1205): raise logger.error("Deadlock") @@ -82,7 +82,7 @@ def clear_notifications(user=None): frappe.db.sql("""delete from `tabNotification Count`""") except MySQLdb.OperationalError, e: - if e.args[0] != 1213: + if e.args[0] not in (1213, 1205): raise logger.error("Deadlock") @@ -94,7 +94,7 @@ def delete_notification_count_for(doctype): frappe.db.sql("""delete from `tabNotification Count` where for_doctype = %s""", (doctype,)) except MySQLdb.OperationalError, e: - if e.args[0] != 1213: + if e.args[0] not in (1213, 1205): raise logger.error("Deadlock")