1
0
This commit is contained in:
2023-01-26 18:30:51 +01:00
parent ad73b91cc5
commit 098ecdbecb
4 changed files with 20 additions and 15 deletions

View File

@@ -272,6 +272,7 @@ if (file_exists($dataPath . "events.db"))
}
}
// topics definition
listHooks("./topics_callbacks", $topicsCallbacks);
if (!empty($topicsCallbacks))
@@ -341,8 +342,6 @@ if (file_exists($dataPath . "devices.db"))
}
}
// Program start
logger(DEBUG, _("Program start"), __FILE__ . ":" . __LINE__);
$client = new Mosquitto\Client();
@@ -387,7 +386,7 @@ configWatchInit();
while (true)
{
// test if looping is more then 5 second and send and alert
echo date("c") . " début";
// echo date("c") . " début";
$now = new datetime("now");
$testTime = clone $now;
$testTime->modify("-5 second");
@@ -398,14 +397,15 @@ while (true)
$timeLoop = $now;
$client->loop(); // mqtt server loop()
echo date("c") . " One shot";
if ($oneshot === false) // execute while the first loop :WARNING hooks may not be initialized
if ($oneshot === false) // execute while the first loop :WARNING all hooks may not be initialized
{
echo date("c") . " One shot";
logger(DEBUG, _("Oneshot part of loop"), __FILE__ . ":" . __LINE__, false);
pws2mqttGetList();
$oneshot = true;
}
echo date("c") . " initialisation des hooks";
//echo date("c") . " initialisation des hooks";
if($hooksInitialized == 0) // all hooks are not initialized
{
$i = 1;
@@ -432,13 +432,13 @@ echo date("c") . " initialisation des hooks";
{
//logger(DEBUG, _("looping"), __FILE__ . ":" . __LINE__);
}
echo date("c") . " chech events";
// echo date("c") . " chech events";
checkEvents();
echo date("c") . " topics availabiblity";
// echo date("c") . " topics availabiblity";
checkTopicsAvailability();
echo date("c") . " apiserver";
//echo date("c") . " apiserver";
if ($apiServerIsActive) apiServer($read);
echo date("c") . " surveillance Configuration";
//echo date("c") . " surveillance Configuration";
// surveillance du dossier de configuration
if ($cwfd !== false)
{
@@ -458,7 +458,7 @@ echo date("c") . " surveillance Configuration";
}
}
}
echo date("c") . " fin";
//echo date("c") . " fin";
}
endMoha();