refactor(recorder): Add explanation for patching frappe.db.sql
This commit is contained in:
parent
dc6ea19c2a
commit
7431a6b682
1 changed files with 6 additions and 0 deletions
|
|
@ -115,6 +115,10 @@ def application(request):
|
|||
rollback = True
|
||||
|
||||
init_request(request)
|
||||
|
||||
# Need to record all calls to frappe.db.sql
|
||||
# Should be done after frappe.db refers to an instance of Database
|
||||
# Now is a good time
|
||||
frappe.db.sql = recorder(frappe.db.sql)
|
||||
|
||||
if frappe.local.form_dict.cmd:
|
||||
|
|
@ -157,6 +161,8 @@ def application(request):
|
|||
if response and hasattr(frappe.local, 'cookie_manager'):
|
||||
frappe.local.cookie_manager.flush_cookies(response=response)
|
||||
|
||||
# Recorded calls need to be stored in cache
|
||||
# This looks like a terribe syntax, Because it actually is
|
||||
persist(frappe.db.sql)
|
||||
frappe.destroy()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue