fix: [d4] change enable d4

This commit is contained in:
Terrtia 2023-06-07 11:03:32 +02:00
parent 4cd2b6517b
commit 70802205f2
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -50,8 +50,8 @@ def is_passive_dns_enabled(cache=True):
def change_passive_dns_state(new_state): def change_passive_dns_state(new_state):
old_state = is_passive_dns_enabled(cache=False) old_state = is_passive_dns_enabled(cache=False)
if old_state != new_state: if old_state != new_state:
r_serv_db.hset('d4:passivedns', 'enabled', bool(new_state)) r_serv_db.hset('d4:passivedns', 'enabled', str(new_state))
r_cache.set('d4:passivedns:enabled', bool(new_state)) r_cache.set('d4:passivedns:enabled', str(new_state))
update_time = time.time() update_time = time.time()
r_serv_db.hset('d4:passivedns', 'update_time', update_time) r_serv_db.hset('d4:passivedns', 'update_time', update_time)
r_cache.set('d4:passivedns:last_update_time', update_time) r_cache.set('d4:passivedns:last_update_time', update_time)