fix: deferred insert json.loads() typeError (#6577)

This commit is contained in:
pengfeiqin 2018-12-06 22:44:51 +08:00 committed by Suraj Shetty
parent b2779c617a
commit b9d6e2d1ea

View file

@ -17,7 +17,7 @@ def save_to_db():
doctype = get_doctype_name(key)
while frappe.cache().llen(queue_key) > 0 and record_count <= 500:
records = frappe.cache().lpop(queue_key)
records = json.loads(records)
records = json.loads(records.decode('utf-8'))
if isinstance(records, dict):
record_count += 1
insert_record(records, doctype)
@ -41,4 +41,4 @@ def get_key_name(key):
return cstr(key).split('|')[1]
def get_doctype_name(key):
return cstr(key).split(queue_prefix)[1]
return cstr(key).split(queue_prefix)[1]