From 2d32a901daebb3191c4f47ed5cefdb17106fc34e Mon Sep 17 00:00:00 2001 From: TheWitness Date: Sun, 11 Jun 2023 08:54:59 -0400 Subject: [PATCH] Fixing #5364 - Cactid initial startup provides false error message Cactid, on initial startup reports that the database connection went away which is erroneous --- CHANGELOG | 1 + cactid.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 4dd2a91288..7681e5b4fa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -35,6 +35,7 @@ Cacti CHANGELOG -issue#5355: SNMP Uptime is not always ignored for spikekills -issue#5356: Improve downed Device detection -issue#5360: Plugin missing functions warning should be debounced +-issue#5364: Cactid, on initial startup reports that the database connection went away which is erroneous -feature: Upgrade billboard.js to version 3.7.4 -feature: Upgrade d3.js to version 7.8.2 -feature: Upgrade ua-parser.js to version 1.0.35 diff --git a/cactid.php b/cactid.php index 2c64f48799..4c599e9d1a 100755 --- a/cactid.php +++ b/cactid.php @@ -63,6 +63,7 @@ function sig_handler($signo) { $hostname = gethostname(); $debug = false; $foreground = false; +$firstuse = true; chdir(__DIR__); include_once('./include/cli_check.php'); @@ -147,7 +148,10 @@ function sig_handler($signo) { while (true) { wait_for_start($frequency); - db_check_reconnect(); + if (!$firstuse) { + db_check_reconnect(); + $firstuse = false; + } run_poller();