1
0

test de viteese de boucle principale

This commit is contained in:
Daniel Tartavel 2022-12-14 11:00:16 +01:00
parent 8974d3de84
commit c018d8c0b7

View File

@ -387,6 +387,7 @@ configWatchInit();
while (true) while (true)
{ {
// test if looping is more then 5 second and send and alert // test if looping is more then 5 second and send and alert
echo date("c") . " début";
$now = new datetime("now"); $now = new datetime("now");
$testTime = clone $now; $testTime = clone $now;
$testTime->modify("-5 second"); $testTime->modify("-5 second");
@ -397,14 +398,14 @@ while (true)
$timeLoop = $now; $timeLoop = $now;
$client->loop(); // mqtt server loop() $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 hooks may not be initialized
{ {
logger(DEBUG, _("Oneshot part of loop"), __FILE__ . ":" . __LINE__, false); logger(DEBUG, _("Oneshot part of loop"), __FILE__ . ":" . __LINE__, false);
pws2mqttGetList(); pws2mqttGetList();
$oneshot = true; $oneshot = true;
} }
echo date("c") . " initialisation des hooks";
if($hooksInitialized == 0) // all hooks are not initialized if($hooksInitialized == 0) // all hooks are not initialized
{ {
$i = 1; $i = 1;
@ -431,11 +432,13 @@ while (true)
{ {
//logger(DEBUG, _("looping"), __FILE__ . ":" . __LINE__); //logger(DEBUG, _("looping"), __FILE__ . ":" . __LINE__);
} }
echo date("c") . " chech events";
checkEvents(); checkEvents();
echo date("c") . " topics availabiblity";
checkTopicsAvailability(); checkTopicsAvailability();
echo date("c") . " apiserver";
if ($apiServerIsActive) apiServer($read); if ($apiServerIsActive) apiServer($read);
echo date("c") . " surveillance Configuration";
// surveillance du dossier de configuration // surveillance du dossier de configuration
if ($cwfd !== false) if ($cwfd !== false)
{ {
@ -455,6 +458,7 @@ while (true)
} }
} }
} }
echo date("c") . " fin";
} }
endMoha(); endMoha();