@andersbakken/fisk 4.0.49 → 4.0.52
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/builder/fisk-builder.js
CHANGED
|
@@ -7626,6 +7626,10 @@ class ObjectCache extends EventEmitter__default["default"] {
|
|
|
7626
7626
|
this.purge(0);
|
|
7627
7627
|
}
|
|
7628
7628
|
add(response, contents) {
|
|
7629
|
+
if (!response.sha1) {
|
|
7630
|
+
console.error("Cannot add to cache without valid sha1", response);
|
|
7631
|
+
return;
|
|
7632
|
+
}
|
|
7629
7633
|
if (response.sha1 in this.pending) {
|
|
7630
7634
|
console.log("Already writing this, I suppose this is possible", response);
|
|
7631
7635
|
return;
|
|
@@ -51219,6 +51223,11 @@ class Server extends EventEmitter__default["default"] {
|
|
|
51219
51223
|
if (Array.isArray(builderIp)) {
|
|
51220
51224
|
builderIp = String(builderIp);
|
|
51221
51225
|
}
|
|
51226
|
+
const sha1 = req.headers["x-fisk-sha1"];
|
|
51227
|
+
if (Array.isArray(sha1)) {
|
|
51228
|
+
error("Bad sha1 header [" + sha1.join(", ") + "]");
|
|
51229
|
+
return;
|
|
51230
|
+
}
|
|
51222
51231
|
client = new Job({
|
|
51223
51232
|
builderIp,
|
|
51224
51233
|
hash,
|
|
@@ -51227,7 +51236,7 @@ class Server extends EventEmitter__default["default"] {
|
|
|
51227
51236
|
ip,
|
|
51228
51237
|
name,
|
|
51229
51238
|
priority: parseInt(String(req.headers["x-fisk-priority"])),
|
|
51230
|
-
sha1
|
|
51239
|
+
sha1,
|
|
51231
51240
|
sourceFile: String(req.headers["x-fisk-sourcefile"]),
|
|
51232
51241
|
user: String(req.headers["x-fisk-user"]),
|
|
51233
51242
|
supportsCompressedResponse: req.headers["x-fisk-supports-compressed-response"] === "true",
|
|
@@ -55266,7 +55275,7 @@ function getFromCache(job, cb) {
|
|
|
55266
55275
|
// console.log("got job", job.sha1, objectCache ? objectCache.state(job.sha1) : false);
|
|
55267
55276
|
// if (objectCache)
|
|
55268
55277
|
// console.log("objectCache", job.sha1, objectCache.state(job.sha1), objectCache.keys);
|
|
55269
|
-
if (!objectCache || objectCache.state(job.sha1) !== "exists") {
|
|
55278
|
+
if (!objectCache || !job.sha1 || objectCache.state(job.sha1) !== "exists") {
|
|
55270
55279
|
return false;
|
|
55271
55280
|
}
|
|
55272
55281
|
const file = path__default["default"].join(objectCache.dir, job.sha1);
|
|
@@ -55305,7 +55314,9 @@ function getFromCache(job, cb) {
|
|
|
55305
55314
|
fs$3.closeSync(fd);
|
|
55306
55315
|
}
|
|
55307
55316
|
if (err) {
|
|
55308
|
-
|
|
55317
|
+
if (job.sha1) {
|
|
55318
|
+
objectCache === null || objectCache === void 0 ? void 0 : objectCache.remove(job.sha1);
|
|
55319
|
+
}
|
|
55309
55320
|
job.close();
|
|
55310
55321
|
}
|
|
55311
55322
|
else {
|