@andersbakken/fisk 4.0.20 → 4.0.23
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/builder/fisk-builder.js +14 -3
- package/package.json +1 -1
- package/scheduler/fisk-scheduler.js +3677 -3375
package/builder/fisk-builder.js
CHANGED
|
@@ -51373,7 +51373,7 @@ class Load extends EventEmitter__default["default"] {
|
|
|
51373
51373
|
const load = new Load();
|
|
51374
51374
|
|
|
51375
51375
|
function quitOnError(option) {
|
|
51376
|
-
return
|
|
51376
|
+
return () => {
|
|
51377
51377
|
const quitInterval = option.int("quit-on-error-delay", 2000);
|
|
51378
51378
|
if (quitInterval >= 0) {
|
|
51379
51379
|
console.log(`Quitting in ${quitInterval}ms`);
|
|
@@ -55167,7 +55167,6 @@ client.on("fetch_cache_objects", (msg) => {
|
|
|
55167
55167
|
resolve();
|
|
55168
55168
|
return;
|
|
55169
55169
|
}
|
|
55170
|
-
// response_stream.on("response", function (response) {
|
|
55171
55170
|
axios({ method: "get", url: url, responseType: "stream" })
|
|
55172
55171
|
.then((response) => {
|
|
55173
55172
|
expectedSize = parseInt(response.headers["content-length"]);
|
|
@@ -55515,10 +55514,22 @@ client.on("close", () => {
|
|
|
55515
55514
|
}, 1000);
|
|
55516
55515
|
}
|
|
55517
55516
|
});
|
|
55517
|
+
client.on("command", (command) => {
|
|
55518
|
+
console.log("Got command", command);
|
|
55519
|
+
child_process__default["default"].exec(command.command, { encoding: "utf8" }, (err, stdout, stderr) => {
|
|
55520
|
+
if (stdout) {
|
|
55521
|
+
console.log("Got stdout from", command, stdout);
|
|
55522
|
+
}
|
|
55523
|
+
if (stderr) {
|
|
55524
|
+
console.error("Got stderr from", command, stderr);
|
|
55525
|
+
}
|
|
55526
|
+
client.send({ type: "command", id: command.id, command: command.command, stdout, stderr });
|
|
55527
|
+
});
|
|
55528
|
+
});
|
|
55518
55529
|
const server = new Server(option, common.Version);
|
|
55519
55530
|
const jobQueue = [];
|
|
55520
55531
|
server.on("headers", (headers, req) => {
|
|
55521
|
-
// console.log("request is", req.
|
|
55532
|
+
// console.log("request is", req.url);
|
|
55522
55533
|
let wait = false;
|
|
55523
55534
|
if (objectCache && objectCache.state(req.headers["x-fisk-sha1"]) === "exists") {
|
|
55524
55535
|
wait = true;
|