0 && time() - $last < $interval) { return false; } $state["last_heartbeat_at"] = time(); manageActivityWriteState($state); manageHeartbeatSendQuietly(); return true; } /** * Runs the due jobs for one admin page view. * * @return array{message: string, type: string} empty message when nothing happened */ function manageActivityRunDueTasks(): array { $result = ["message" => "", "type" => ""]; $backup = null; try { $backup = manageBackupCreateAutomaticIfDue(); if ($backup !== null) { $result = [ "message" => "Automatisches Backup wurde erstellt: " . $backup["filename"] . ".", "type" => "success", ]; } } catch (Throwable $exception) { $result = [ "message" => "Automatisches Backup konnte nicht erstellt werden: " . $exception->getMessage(), "type" => "warning", ]; } // A fresh backup is worth reporting right away, so the server dashboard // does not show a stale "last backup" for up to another interval. manageActivityHeartbeatIfDue($backup !== null); return $result; }