mirror of
https://github.com/erpalma/throttled.git
synced 2026-01-02 22:59:56 +01:00
Don't reload changes when the config file has been deleted
This commit is contained in:
parent
dfdda3b1b7
commit
46a062e14d
|
|
@ -542,7 +542,10 @@ def set_disable_bdprochot():
|
|||
|
||||
|
||||
def get_config_write_time():
|
||||
return os.stat(args.config).st_mtime
|
||||
try:
|
||||
return os.stat(args.config).st_mtime
|
||||
except FileNotFoundError:
|
||||
return None
|
||||
|
||||
|
||||
def power_thread(config, regs, exit_event):
|
||||
|
|
@ -563,9 +566,9 @@ def power_thread(config, regs, exit_event):
|
|||
for key, value in core_thermal_status.items():
|
||||
log('[D] core {} thermal status: {} = {}'.format(index, key.replace("_", " "), value))
|
||||
|
||||
# Reload config when modified
|
||||
# Reload config when modified (unless it no longer exists)
|
||||
config_write_time = get_config_write_time()
|
||||
if last_config_write_time != config_write_time:
|
||||
if config_write_time and last_config_write_time != config_write_time:
|
||||
last_config_write_time = config_write_time
|
||||
config = load_config()
|
||||
log('[I] Reloading changes.')
|
||||
|
|
|
|||
Loading…
Reference in a new issue