Protect stats from corrupted files
parent
6d6538664e
commit
caa7463b70
|
@ -14,7 +14,10 @@ def get_stats():
|
||||||
stats = {}
|
stats = {}
|
||||||
for filename in os.listdir(stats_dir):
|
for filename in os.listdir(stats_dir):
|
||||||
with open(stats_dir + "/" + filename) as json_file:
|
with open(stats_dir + "/" + filename) as json_file:
|
||||||
raw = json.load(json_file)['stats']
|
try:
|
||||||
|
raw = json.load(json_file)['stats']
|
||||||
|
except:
|
||||||
|
continue
|
||||||
clean = {}
|
clean = {}
|
||||||
raw_copy = copy.deepcopy(raw)
|
raw_copy = copy.deepcopy(raw)
|
||||||
for ra in raw_copy:
|
for ra in raw_copy:
|
||||||
|
|
Loading…
Reference in New Issue