add more logs
parent
10a7b9591a
commit
1f069904bc
|
@ -95,13 +95,17 @@ logit( "Subscribed");
|
|||
|
||||
$timer = 0;
|
||||
|
||||
logit("Started listening for incoming messages\n will wait 60 seconds before starting to export data");
|
||||
logit(
|
||||
"Started listening for incoming messages\n will wait 60 seconds before starting to export data"
|
||||
);
|
||||
$realStart = time() + 15;
|
||||
logit( "waiting till " .
|
||||
logit(
|
||||
"waiting till " .
|
||||
date("Y-m-d H:i:s", $realStart) .
|
||||
" that's in " .
|
||||
($realStart - time()) .
|
||||
" seconds");
|
||||
" seconds"
|
||||
);
|
||||
while (time() < $realStart) {
|
||||
$wait = time() + 5;
|
||||
$mqtt->loop(5000);
|
||||
|
@ -117,9 +121,10 @@ while ($isRunning) {
|
|||
$mqtt->loop(1000);
|
||||
|
||||
if ($lastGC + 60 < time()) {
|
||||
gc_collect_cycles();
|
||||
logit("doing Garbage collection...");
|
||||
$c = gc_collect_cycles();
|
||||
logit("Garbage collection done, $c cycles collected");
|
||||
$lastGC = time();
|
||||
logit("doint GC");
|
||||
}
|
||||
|
||||
if ($loopEnd > microtime(true)) {
|
||||
|
@ -387,8 +392,8 @@ function endit(): void
|
|||
error("Exiting");
|
||||
}
|
||||
|
||||
|
||||
function logit():void{
|
||||
function logit(): void
|
||||
{
|
||||
echo date("[Y-m-d H:i:s]") . " " . implode(" ", func_get_args()) . "\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue