mirror of https://gitlab.com/bashrc2/epicyon
Avoid None returned when loading fitness file
parent
9ef2a22b7a
commit
6fb410276c
|
@ -21029,7 +21029,9 @@ def run_daemon(map_format: str,
|
||||||
fitness_filename = base_dir + '/accounts/fitness.json'
|
fitness_filename = base_dir + '/accounts/fitness.json'
|
||||||
httpd.fitness = {}
|
httpd.fitness = {}
|
||||||
if os.path.isfile(fitness_filename):
|
if os.path.isfile(fitness_filename):
|
||||||
httpd.fitness = load_json(fitness_filename)
|
fitness = load_json(fitness_filename)
|
||||||
|
if fitness is not None:
|
||||||
|
httpd.fitness = fitness
|
||||||
|
|
||||||
# initialize authorized fetch key
|
# initialize authorized fetch key
|
||||||
httpd.signing_priv_key_pem = None
|
httpd.signing_priv_key_pem = None
|
||||||
|
|
|
@ -20,6 +20,8 @@ def fitness_performance(startTime, fitness_state: {},
|
||||||
debug: bool) -> None:
|
debug: bool) -> None:
|
||||||
"""Log a performance watchpoint
|
"""Log a performance watchpoint
|
||||||
"""
|
"""
|
||||||
|
if fitness_state is None:
|
||||||
|
return
|
||||||
if 'performance' not in fitness_state:
|
if 'performance' not in fitness_state:
|
||||||
fitness_state['performance'] = {}
|
fitness_state['performance'] = {}
|
||||||
if fitness_id not in fitness_state['performance']:
|
if fitness_id not in fitness_state['performance']:
|
||||||
|
|
Loading…
Reference in New Issue