Jellyfin: who is watching, and don't update a machine mid-film
New Jellyfin integration (read-only, every 2 minutes): version, restart wanted, streams and transcoding, failed scheduled tasks, item counts, failed sign-ins. Monitoring -> Jellyfin page with a peak-streams history, three alerts, /metrics. When Jellyfin runs on a managed server, an update run asks first if people are streaming (409 "watching" unless startAnyway), and a patch plan waits up to two hours for them before updating that server. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f082ca5c2
commit
0146eb8bca
38 files changed
+8136
-13
No files matched your search
@@ -42,6 +42,19 @@ export default function UpdateRunDrawer({ server, onClose, onStarted }: { server
|
||||
const [limit, setLimit] = useState(server.name);
|
||||
const [minutes, setMinutes] = useState(90);
|
||||
const [busy, setBusy] = useState(false);
|
||||
// People streaming from a Jellyfin on this machine: the update may restart it, so they are named first and the person asked.
|
||||
const [watching, setWatching] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
let alive = true;
|
||||
api.jellyfin
|
||||
.watching(server.id)
|
||||
.then((r) => alive && setWatching(r.words))
|
||||
.catch(() => undefined); // no Jellyfin, or it can't be read: nothing to warn about
|
||||
return () => {
|
||||
alive = false;
|
||||
};
|
||||
}, [server.id]);
|
||||
|
||||
useEffect(() => {
|
||||
let alive = true;
|
||||
@@ -68,13 +81,13 @@ export default function UpdateRunDrawer({ server, onClose, onStarted }: { server
|
||||
if (!picked) return;
|
||||
const ok = await confirmDialog({
|
||||
title: `Update ${server.name} now?`,
|
||||
message: `This silences alerts for ${server.name} for up to ${WINDOWS.find((w) => w.minutes === minutes)?.label ?? `${minutes} minutes`}, runs "${picked.template.name}" in ${picked.integration.name} limited to ${limit.trim()}, and waits for the server to report again. The playbook may restart it.`,
|
||||
confirmLabel: "Start the update",
|
||||
message: `${watching ? `${watching[0].toUpperCase()}${watching.slice(1)}, and the update may restart the machine. ` : ""}This silences alerts for ${server.name} for up to ${WINDOWS.find((w) => w.minutes === minutes)?.label ?? `${minutes} minutes`}, runs "${picked.template.name}" in ${picked.integration.name} limited to ${limit.trim()}, and waits for the server to report again. The playbook may restart it.`,
|
||||
confirmLabel: watching ? "Update anyway" : "Start the update",
|
||||
});
|
||||
if (!ok) return;
|
||||
setBusy(true);
|
||||
try {
|
||||
await api.updateRuns.start({ serverId: server.id, integrationId: picked.integration.id, projectId: picked.template.projectId, templateId: picked.template.id, limit: limit.trim(), windowMinutes: minutes });
|
||||
await api.updateRuns.start({ serverId: server.id, integrationId: picked.integration.id, projectId: picked.template.projectId, templateId: picked.template.id, limit: limit.trim(), windowMinutes: minutes, startAnyway: watching !== "" });
|
||||
try {
|
||||
localStorage.setItem(LAST_KEY, picked.key);
|
||||
} catch {
|
||||
@@ -112,6 +125,12 @@ export default function UpdateRunDrawer({ server, onClose, onStarted }: { server
|
||||
<div className="mb-3">
|
||||
<ImpactNote targets={[{ type: "server", id: server.id }]} verb="may look down while it restarts" />
|
||||
</div>
|
||||
{watching && (
|
||||
<div className="alert alert-warning" role="status">
|
||||
<strong>Somebody is watching.</strong> {watching[0].toUpperCase()}
|
||||
{watching.slice(1)}. The update may restart this machine; you will be asked once more.
|
||||
</div>
|
||||
)}
|
||||
<ol className="text-secondary small ps-3 mb-3">
|
||||
<li>Alerts for this server are silenced (a maintenance window).</li>
|
||||
<li>The playbook runs in Semaphore, for this server only.</li>
|
||||
|
||||
Reference in new issue
Block a user