Skip to content

Commit

Permalink
perf: compact prepared report files
Browse files Browse the repository at this point in the history
No one reads these, no need to indent them.

(cherry picked from commit 135fd33)
  • Loading branch information
ankush authored and mergify[bot] committed Mar 12, 2024
1 parent dcb7429 commit 3adbb35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/core/doctype/prepared_report/prepared_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def create_json_gz_file(data, dt, dn):
# Storing data in CSV file causes information loss
# Reports like P&L Statement were completely unsuable because of this
json_filename = "{}.json.gz".format(frappe.utils.data.format_datetime(frappe.utils.now(), "Y-m-d-H:M"))
encoded_content = frappe.safe_encode(frappe.as_json(data))
encoded_content = frappe.safe_encode(frappe.as_json(data, indent=None, separators=(",", ":")))
compressed_content = gzip.compress(encoded_content)

# Call save() file function to upload and attach the file
Expand Down

0 comments on commit 3adbb35

Please sign in to comment.