Reload blocking mode independently of incoming queries

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2022-02-28 21:22:56 +01:00
parent cb0d42db1c
commit 7f7dc2e9fa
5 changed files with 15 additions and 13 deletions
+10 -2
View File
@@ -26,6 +26,8 @@
#include "aliasclients.h"
// Eventqueue routines
#include "../events.h"
// check_blocking_status()
#include "../setupVars.h"
#define DBOPEN_OR_AGAIN() { db = dbopen(false); if(db == NULL) { thread_sleepms(DB, 5000); continue; } }
#define BREAK_IF_KILLED() { if(killed) break; }
@@ -116,8 +118,14 @@ void *DB_thread(void *val)
BREAK_IF_KILLED();
// Sleep 1 sec
thread_sleepms(DB, 1000);
// Inspect setupVars.conf to see if Pi-hole blocking is enabled
if(get_and_clear_event(RELOAD_BLOCKINGSTATUS))
check_blocking_status();
BREAK_IF_KILLED();
// Sleep 0.1 sec
thread_sleepms(DB, 100);
}
logg("Terminating database thread");