Skip to content

Commit

Permalink
fix(Database): clear background jobs and realtime logs on rollback (#…
Browse files Browse the repository at this point in the history
…20236) (#20416)

(cherry picked from commit e9dfa80)

Co-authored-by: Saif Ur Rehman <saif@paralogic.io>
  • Loading branch information
mergify[bot] and SaiFi0102 committed Mar 21, 2023
1 parent 85cd2d2 commit f4f399e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frappe/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,9 @@ def rollback(self, *, save_point=None):
if hasattr(obj, "on_rollback"):
obj.on_rollback()
frappe.local.rollback_observers = []

frappe.local.realtime_log = []
frappe.flags.enqueue_after_commit = []

def field_exists(self, dt, fn):
"""Return true of field exists."""
Expand Down

0 comments on commit f4f399e

Please sign in to comment.