Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion AniSmooth/js/utils/flowframesHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
var finished = false;
var aiComplete = false;
var lastLogTime = Date.now();
var watchdogSize = -1;

var finalize = function (ok, message, producedPath) {
if (finished) return;
Expand Down Expand Up @@ -215,6 +216,7 @@
try {
var content = fs.readFileSync(sessionLog, "utf8");
var lines = content.split(/\r?\n/);
if (lines.length > lastLineCount) {
for (var j = lastLineCount; j < lines.length; j++) {
var ln = lines[j];
if (!ln) continue;
Expand All @@ -238,6 +240,7 @@
}
lastLineCount = lines.length;
lastLogTime = Date.now();
}
} catch (e) {}
}

Expand Down Expand Up @@ -268,7 +271,19 @@
}

if (!finished && Date.now() - lastLogTime > 60000) {
finalize(false, "Flowframes stalled - no progress for 60 seconds.");
var wOut = findNewestOutput();
var wGrew = false;
if (wOut) {
try {
var wSz = fs.statSync(wOut).size;
if (wSz !== watchdogSize) { watchdogSize = wSz; wGrew = true; }
} catch (e) {}
}
if (wGrew) {
lastLogTime = Date.now();
} else {
finalize(false, "Flowframes stopped responding - no progress for 60 seconds.");
}
}
}, 1500);

Expand Down