From 0c5c4e5797d3f0d5d6a5bd07b41a22b3d579e274 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sat, 29 Jul 2023 15:02:11 +0530 Subject: [PATCH 1/2] fix: only publish repost progress to doc subscriber (#36400) Huge size of string gets blasted to everyone on site. Due to some memory leak (cause unknown) till sockets are open the strings are also in process' memory. related https://github.com/frappe/frappe/issues/21863 (cherry picked from commit c0642cf528e2054192f5d16dd9d5c1a8162069cf) # Conflicts: # erpnext/stock/stock_ledger.py --- erpnext/stock/stock_ledger.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index e1aa01906b3c..8d89a86c4ac6 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -277,7 +277,18 @@ def update_args_in_repost_item_valuation( frappe.publish_realtime( "item_reposting_progress", +<<<<<<< HEAD {"name": doc.name, "items_to_be_repost": json.dumps(args, default=str), "current_index": index}, +======= + { + "name": doc.name, + "items_to_be_repost": json.dumps(args, default=str), + "current_index": index, + "total_reposting_count": len(args), + }, + doctype=doc.doctype, + docname=doc.name, +>>>>>>> c0642cf528 (fix: only publish repost progress to doc subscriber (#36400)) ) From ac6e0e9085cdec3c8c2ce90fc572ecf56e585b7f Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sat, 29 Jul 2023 17:12:06 +0530 Subject: [PATCH 2/2] chore: conflicts --- erpnext/stock/stock_ledger.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 8d89a86c4ac6..a3f0032b8ac0 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -277,18 +277,9 @@ def update_args_in_repost_item_valuation( frappe.publish_realtime( "item_reposting_progress", -<<<<<<< HEAD {"name": doc.name, "items_to_be_repost": json.dumps(args, default=str), "current_index": index}, -======= - { - "name": doc.name, - "items_to_be_repost": json.dumps(args, default=str), - "current_index": index, - "total_reposting_count": len(args), - }, doctype=doc.doctype, docname=doc.name, ->>>>>>> c0642cf528 (fix: only publish repost progress to doc subscriber (#36400)) )