Jay-Rajput commited on
Commit
d79e927
·
1 Parent(s): d50e2d0

points redistribution

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -292,8 +292,10 @@ def display_predictions():
292
 
293
  def redistribute_lost_points(match_id) -> dict:
294
  # Load already processed matches
295
- with open(REDISTRIBUTED_JSON, "r") as f:
296
- done_matches = json.load(f)
 
 
297
 
298
  if match_id in done_matches:
299
  return {}
 
292
 
293
  def redistribute_lost_points(match_id) -> dict:
294
  # Load already processed matches
295
+ if not os.path.exists(REDISTRIBUTED_JSON) or os.stat(REDISTRIBUTED_JSON).st_size == 0:
296
+ with open(REDISTRIBUTED_JSON, "w") as f:
297
+ json.dump([], f)
298
+ done_matches = load_data(REDISTRIBUTED_JSON)
299
 
300
  if match_id in done_matches:
301
  return {}