From 42b5e097bbecd9d2f5dfb50392c3a48b13543841 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 26 Dec 2023 10:32:59 +0000 Subject: [PATCH] Force options reload when connections are reset --- bridge_master.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index f4fa326..ec4380d 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -1047,7 +1047,7 @@ def options_config(): _tmout = int(_options['DEFAULT_UA_TIMER']) - if int(_options['DEFAULT_UA_TIMER']) != CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER']: + if CONFIG['SYSTEMS'][_system]['_reloadoptions'] or (int(_options['DEFAULT_UA_TIMER']) != CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER']): logger.debug('(OPTIONS) %s Updating DEFAULT_UA_TIMER for existing bridges.',_system) update_timeout(_system,_tmout) @@ -1064,7 +1064,7 @@ def options_config(): reset_all_reflector_system(_tmout,_system) ts1 = [] - if _options['TS1_STATIC'] != CONFIG['SYSTEMS'][_system]['TS1_STATIC']: + if CONFIG['SYSTEMS'][_system]['_reloadoptions'] or (_options['TS1_STATIC'] != CONFIG['SYSTEMS'][_system]['TS1_STATIC']): _tmout = int(_options['DEFAULT_UA_TIMER']) logger.debug('(OPTIONS) %s TS1 static TGs changed, updating',_system) ts1 = [] @@ -1085,7 +1085,7 @@ def options_config(): tg = int(tg) make_static_tg(tg,1,_tmout,_system) ts2 = [] - if _options['TS2_STATIC'] != CONFIG['SYSTEMS'][_system]['TS2_STATIC']: + if CONFIG['SYSTEMS'][_system]['_reloadoptions'] or (_options['TS2_STATIC'] != CONFIG['SYSTEMS'][_system]['TS2_STATIC']): _tmout = int(_options['DEFAULT_UA_TIMER']) logger.debug('(OPTIONS) %s TS2 static TGs changed, updating',_system) if CONFIG['SYSTEMS'][_system]['TS2_STATIC']: @@ -1112,6 +1112,9 @@ def options_config(): CONFIG['SYSTEMS'][_system]['TS2_STATIC'] = _options['TS2_STATIC'] CONFIG['SYSTEMS'][_system]['DEFAULT_REFLECTOR'] = int(_options['DEFAULT_REFLECTOR']) CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER'] = int(_options['DEFAULT_UA_TIMER']) + + if CONFIG['SYSTEMS'][_system]['_reloadoptions']: + CONFIG['SYSTEMS'][_system]['_reloadoptions'] = False except Exception as e: logger.exception('(OPTIONS) caught exception: %s',e) continue