Recover a shot left stuck on "filming" by a worker restart
Third occurrence of this shape after cuts and the storyboard reel: a flag meaning "work is happening" set before an in-memory thread starts, never cleared when a deploy kills it, and a page that then hides the buttons for ever. Anything older than 25 minutes is treated as gone.
This commit is contained in:
parent
a1ededf9c5
commit
d7ac094c9c
1 changed files with 11 additions and 2 deletions
13
trailer.html
13
trailer.html
|
|
@ -181,9 +181,18 @@
|
|||
function busyRun() {
|
||||
return RUN && /^(writing|reviewing|revising)$/.test(String(RUN.stage || ""));
|
||||
}
|
||||
// Work happens in the worker's memory and does not survive a deploy, so a
|
||||
// flag saying "in progress" is only believed while it is recent.
|
||||
function stillFilming(s) {
|
||||
if (!s.filming) return false;
|
||||
var t = Date.parse(s.filming_since || "");
|
||||
if (!t) return false; // no stamp: from before this existed
|
||||
return (Date.now() - t) < 25 * 60 * 1000;
|
||||
}
|
||||
|
||||
function busyShots() {
|
||||
return (PKG.shots || []).some(function (s) {
|
||||
return s.writing || s.drawing || s.filming; });
|
||||
return s.writing || s.drawing || stillFilming(s); });
|
||||
}
|
||||
|
||||
// Preparing the storyboard audio is work too. Without this the page stops
|
||||
|
|
@ -859,7 +868,7 @@
|
|||
|
||||
var tools;
|
||||
if (s.drawing) tools = '<span class="busy">drawing…</span>';
|
||||
else if (s.filming) tools = '<span class="busy">filming…</span>';
|
||||
else if (stillFilming(s)) tools = '<span class="busy">filming…</span>';
|
||||
else if (EDITING === s.id) {
|
||||
tools = '<div style="width:100%"><textarea class="rough" id="rough" rows="3" placeholder="'
|
||||
+ 'What should change in this shot?">' + esc(s.rough || "") + '</textarea>'
|
||||
|
|
|
|||
Loading…
Reference in a new issue