@gentbajko/slopify 4.5.5 → 4.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extension/slopify-studio-chrome.zip +0 -0
- package/dist/extension/slopify-studio-firefox.zip +0 -0
- package/dist/patch-notes/4.5.6.md +12 -0
- package/dist/patch-notes/index.json +6 -0
- package/dist/slices/schedules/continue-stopped.js +45 -0
- package/dist/slices/schedules/scheduler.js +11 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Slopify 4.5.6
|
|
2
|
+
|
|
3
|
+
Released 1 December 2026.
|
|
4
|
+
|
|
5
|
+
A restart no longer leaves a schedule's videos Stopped.
|
|
6
|
+
|
|
7
|
+
## A schedule's videos go on by themselves after a restart
|
|
8
|
+
|
|
9
|
+
- **Videos made ahead no longer read Stopped after a restart.** A restart stops every run that was going, and a video made ahead then read Stopped until someone pressed Continue the run or its day came. Now, a minute after Slopify starts, each of a schedule's videos that a restart stopped goes on as Continue the run would take it on. A video made ahead goes back to Waiting for its day.
|
|
10
|
+
- **A video its day already took no longer holds the schedule back.** When the computer restarted while a schedule's video was still being finished (its shorts or its PDF, say), it stayed Stopped and the schedule skipped every run after it until someone pressed Continue the run. That video now finishes by itself after the restart, and the next runs go ahead.
|
|
11
|
+
- The same limits as the day apply: nothing already made is made or paid for again, a project you paused stays paused, a checkpoint of yours still waits for your approval, and paid steps nobody started are left for you (the log says which video and why).
|
|
12
|
+
- Technical: new `continueStopped` (`schedules/continue-stopped.ts`) runs once, on the schedule runner's first tick after start. It takes every live project with a `prepared_videos` row or in an unsettled `schedule_runs` row of a live schedule, and for each that `projectHolds` reads as stopped it calls `ScheduleDeps.continueRun` (`continueHeldRun`).
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { errorText } from "../../kernel/errors.js";
|
|
3
|
+
import { projectHolds } from "../reviews/holds.js";
|
|
4
|
+
import { projectIsActive } from "./repo.js";
|
|
5
|
+
// The videos a schedule owns: made ahead for a day still to come, or taken by a run whose
|
|
6
|
+
// videos aren't all finished. Oldest first. A deleted schedule owns nothing.
|
|
7
|
+
function scheduledProjects(db) {
|
|
8
|
+
const ids = db
|
|
9
|
+
.prepare(`SELECT p.project_id AS id FROM prepared_videos p
|
|
10
|
+
JOIN schedules s ON s.id=p.schedule_id AND s.deleted_at IS NULL
|
|
11
|
+
UNION
|
|
12
|
+
SELECT admitted.value AS id FROM schedule_runs r, json_each(r.project_ids_json) AS admitted
|
|
13
|
+
JOIN schedules s ON s.id=r.schedule_id AND s.deleted_at IS NULL
|
|
14
|
+
WHERE r.projects_settled_at IS NULL AND r.status!='running'`)
|
|
15
|
+
.all()
|
|
16
|
+
.map((row) => z.string().parse(row.id));
|
|
17
|
+
return [...new Set(ids)].filter((id) => projectIsActive(db, id));
|
|
18
|
+
}
|
|
19
|
+
// A restart stops every run that was going (`recoverWork`), and a schedule's videos then read
|
|
20
|
+
// Stopped until someone presses Continue the run: a made-ahead video until its day, and one its
|
|
21
|
+
// day already took never finishes, so the schedule skips its next runs. A schedule runs without
|
|
22
|
+
// anyone watching, so once Slopify is back each of its videos a restart stopped goes on as
|
|
23
|
+
// Continue the run would take it on (`continueHeldRun`): never past a Pause or a person's
|
|
24
|
+
// checkpoint, and never a paid step nobody started. Returns the projects it continued.
|
|
25
|
+
export async function continueStopped(deps) {
|
|
26
|
+
const { continueRun } = deps;
|
|
27
|
+
if (continueRun === undefined)
|
|
28
|
+
return [];
|
|
29
|
+
const continued = [];
|
|
30
|
+
for (const projectId of scheduledProjects(deps.db)) {
|
|
31
|
+
if (!projectHolds(deps.db, { projectId }).stopped.has(projectId))
|
|
32
|
+
continue;
|
|
33
|
+
try {
|
|
34
|
+
const outcome = await continueRun(projectId);
|
|
35
|
+
if (outcome.kind === "continued")
|
|
36
|
+
continued.push(projectId);
|
|
37
|
+
else if (outcome.kind === "refused")
|
|
38
|
+
deps.log.write("warn", "schedule.continue", { projectId, detail: outcome.sentence });
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
deps.log.write("error", "schedule.continue", { projectId, detail: errorText(error) });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return continued;
|
|
45
|
+
}
|
|
@@ -3,6 +3,7 @@ import { reviewDraft } from "../play-drafts/review.js";
|
|
|
3
3
|
import { createDraft } from "../play-drafts/service.js";
|
|
4
4
|
import { startPlayDraft } from "../play-drafts/start.js";
|
|
5
5
|
import { nextOccurrence } from "./calendar.js";
|
|
6
|
+
import { continueStopped } from "./continue-stopped.js";
|
|
6
7
|
import { claimDesignRun } from "./design-run.js";
|
|
7
8
|
import { overlapSentence } from "./held-back.js";
|
|
8
9
|
import { missedGraceMs } from "./next-run.js";
|
|
@@ -11,6 +12,8 @@ import { activeRun, dueSchedules, insertRun, recordRunDispatch, recordRunStartId
|
|
|
11
12
|
import { generateTopics, generationDue, releaseTopicLeases } from "./topics.js";
|
|
12
13
|
export function createScheduleRunner(deps) {
|
|
13
14
|
let ticking = false;
|
|
15
|
+
// The first tick after Slopify starts continues the schedule's videos a restart stopped.
|
|
16
|
+
let restarted = true;
|
|
14
17
|
// ceiling: one entry per schedule generating now.
|
|
15
18
|
const generations = new Set();
|
|
16
19
|
const stopping = new AbortController();
|
|
@@ -58,6 +61,14 @@ export function createScheduleRunner(deps) {
|
|
|
58
61
|
try {
|
|
59
62
|
recoverRunningRuns(deps.db, now.toISOString(), "The previous schedule tick could not record this run's result.");
|
|
60
63
|
startGenerations(now);
|
|
64
|
+
if (restarted) {
|
|
65
|
+
restarted = false;
|
|
66
|
+
const continued = await continueStopped(deps);
|
|
67
|
+
if (continued.length > 0)
|
|
68
|
+
deps.log.write("info", "schedule.continue", {
|
|
69
|
+
detail: `Continued ${String(continued.length)} scheduled video(s) a restart stopped.`,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
61
72
|
const due = dueSchedules(deps.db, now.toISOString());
|
|
62
73
|
const claimed = due.flatMap((schedule) => claim(deps, schedule, now));
|
|
63
74
|
const settled = await Promise.allSettled(claimed.map((entry) => execute(deps, entry)));
|