Skip to content
This repository was archived by the owner on Feb 21, 2022. It is now read-only.

Commit c206ea8

Browse files
gjuro87aexvir
authored andcommitted
fix(search): handle json decode error when indexing openapi definitions
1 parent 315fcca commit c206ea8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

zoo/globalsearch/indexer.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,17 @@ def index_openapi(self):
5353
definition_keys = redis_conn.keys()
5454
for key in definition_keys:
5555
definition = redis_conn.get(key)
56-
json_definition = json.loads(definition)
56+
try:
57+
json_definition = json.loads(definition)
58+
except json.JSONDecodeError as err:
59+
log.info(
60+
"Failed to decode definition",
61+
error=err,
62+
definition=definition,
63+
key=key,
64+
)
65+
continue
66+
5767
try:
5868
json_definition["id"] = key
5969
self.meiliclient.get_or_create_index("open-api").update_documents(

0 commit comments

Comments
 (0)