Skip to content

Commit

Permalink
Fixed unparsable cache line
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-anzola committed Dec 27, 2021
1 parent 1439518 commit aef7d6f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions script.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ def post_cache():
if os.path.exists(PATH + 'cache.json'):
with open(PATH + 'cache.json') as f:
for jsonLine in f:
obj = json.loads(jsonLine)
send_data(obj)
try:
obj = json.loads(jsonLine)
send_data(obj)
except JSONDecodeError:
write_to_log('Cache line could not be parsed: ' + jsonLine)
os.remove(PATH + 'cache.json')


Expand Down

0 comments on commit aef7d6f

Please sign in to comment.