Skip to content

Commit

Permalink
fix links cache corrupted by json converting int keys to string
Browse files Browse the repository at this point in the history
  • Loading branch information
boogheta committed Aug 21, 2023
1 parent 68a27a6 commit bcf8dd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hyphe_backend/core.tac
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class Core(customJSONRPC):
cache_path = os.path.join(config["traph"]["data_path"], "%s_webentitieslinks.json" % corpus)
try:
with open(cache_path) as f:
return json.load(f)
return json.load(f, object_hook=lambda x: {(int(k) if k.isdigit() else k): v for k, v in x.items()})
except Exception as e:
logger.msg("Could not read cached links from filesystem: %s %s (%s)" % (cache_path, e, type(e)), system="WARNING - %s" % corpus)
return {}
Expand Down

0 comments on commit bcf8dd1

Please sign in to comment.