perf(import_file): use orjson.loads
This commit is contained in:
parent
2e5c8bea03
commit
7660f59c31
1 changed files with 3 additions and 2 deletions
|
|
@ -1,9 +1,10 @@
|
|||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: MIT. See LICENSE
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
|
||||
import orjson
|
||||
|
||||
import frappe
|
||||
from frappe.model.base_document import get_controller
|
||||
from frappe.modules import get_module_path, scrub_dt_dn
|
||||
|
|
@ -173,7 +174,7 @@ def read_doc_from_file(path):
|
|||
if os.path.exists(path):
|
||||
with open(path) as f:
|
||||
try:
|
||||
doc = json.loads(f.read())
|
||||
doc = orjson.loads(f.read())
|
||||
except ValueError:
|
||||
print(f"bad json: {path}")
|
||||
raise
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue