mirror of https://github.com/jumpserver/jumpserver
fix: subscribe_settings_change
parent
682f6b2fb9
commit
6616374c30
|
@ -71,13 +71,19 @@ def subscribe_settings_change(sender, **kwargs):
|
||||||
logger.debug("Start subscribe setting change")
|
logger.debug("Start subscribe setting change")
|
||||||
|
|
||||||
def keep_subscribe():
|
def keep_subscribe():
|
||||||
sub = setting_pub_sub.subscribe()
|
while True:
|
||||||
for msg in sub.listen():
|
try:
|
||||||
if msg["type"] != "message":
|
sub = setting_pub_sub.subscribe()
|
||||||
continue
|
for msg in sub.listen():
|
||||||
item = msg['data'].decode()
|
if msg["type"] != "message":
|
||||||
logger.debug("Found setting change: {}".format(str(item)))
|
continue
|
||||||
Setting.refresh_item(item)
|
item = msg['data'].decode()
|
||||||
|
logger.debug("Found setting change: {}".format(str(item)))
|
||||||
|
Setting.refresh_item(item)
|
||||||
|
except Exception as e:
|
||||||
|
logger.exception(f'subscribe_settings_change: {e}')
|
||||||
|
Setting.refresh_all_settings()
|
||||||
|
|
||||||
t = threading.Thread(target=keep_subscribe)
|
t = threading.Thread(target=keep_subscribe)
|
||||||
t.daemon = True
|
t.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
|
|
Loading…
Reference in New Issue