loadValue('znz_monitoring') ?: []; $lastChangesCount = $monitoring['changesCount'] ?? null; try { $monitoring['changesCount'] = $currentChangesCount = $api->getChangesCount(); } catch (\Throwable $e) { // chyba pri zjistovani poctu zmen ve fronte - nejspis se tam neda pripojit // tak to nechci do monitoringu, protoze to je jejich problem return new Response('1'); } $isOK = 1; if ($lastChangesCount !== null) { $diff = $currentChangesCount - $lastChangesCount; if ($diff >= 0) { $isOK = 0; } } // kdyz nemam data, tak neni co kontrolovat if ($lastChangesCount === null) { $isOK = 1; } // pokud je aktualni pocet zmen 0, tak je to OK if ($currentChangesCount === 0) { $isOK = 1; } $dbcfg->saveValue('znz_monitoring', $monitoring, false); return new Response((string) $isOK); } }