@floomhq/floom 1.0.48 → 1.0.50
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/sync-manifest.js +9 -2
- package/dist/sync.js +2 -2
- package/package.json +1 -1
package/dist/sync-manifest.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { constants, rmSync } from "node:fs";
|
|
2
|
-
import { lstat, mkdir, open, rename, rm, stat } from "node:fs/promises";
|
|
2
|
+
import { lstat, mkdir, open, rename, rm, stat, utimes } from "node:fs/promises";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { CONFIG_DIR } from "./config.js";
|
|
6
6
|
const MANIFEST_VERSION = 1;
|
|
7
|
-
const LOCK_TIMEOUT_MS = 60_000;
|
|
7
|
+
const LOCK_TIMEOUT_MS = 6 * 60_000;
|
|
8
8
|
const LOCK_STALE_MS = 5 * 60_000;
|
|
9
|
+
const LOCK_HEARTBEAT_MS = 30_000;
|
|
9
10
|
const SLUG_RE = /^[A-Za-z0-9_-]{1,128}$/;
|
|
10
11
|
const FD_PATH_ROOT = "/proc/self/fd";
|
|
11
12
|
const SUPPORT_DIRS = new Set([
|
|
@@ -277,10 +278,16 @@ export async function withSyncLock(fn) {
|
|
|
277
278
|
signalHandlers.set(signal, handler);
|
|
278
279
|
process.once(signal, handler);
|
|
279
280
|
}
|
|
281
|
+
const heartbeat = setInterval(() => {
|
|
282
|
+
const now = new Date();
|
|
283
|
+
void utimes(lockPath, now, now).catch(() => { });
|
|
284
|
+
}, LOCK_HEARTBEAT_MS);
|
|
285
|
+
heartbeat.unref?.();
|
|
280
286
|
try {
|
|
281
287
|
return await fn();
|
|
282
288
|
}
|
|
283
289
|
finally {
|
|
290
|
+
clearInterval(heartbeat);
|
|
284
291
|
for (const [signal, handler] of signalHandlers) {
|
|
285
292
|
process.off(signal, handler);
|
|
286
293
|
}
|
package/dist/sync.js
CHANGED
|
@@ -343,7 +343,7 @@ export async function sync(opts = {}) {
|
|
|
343
343
|
if (plan.kind === "unchanged") {
|
|
344
344
|
for (const file of packageFiles)
|
|
345
345
|
markSynced(manifest, manifestKey(root, file.target), skill.slug, file.hash);
|
|
346
|
-
|
|
346
|
+
manifestChanged = true;
|
|
347
347
|
unchanged += 1;
|
|
348
348
|
continue;
|
|
349
349
|
}
|
|
@@ -365,7 +365,7 @@ export async function sync(opts = {}) {
|
|
|
365
365
|
}
|
|
366
366
|
for (const file of packageFiles)
|
|
367
367
|
markSynced(manifest, manifestKey(root, file.target), skill.slug, file.hash);
|
|
368
|
-
|
|
368
|
+
manifestChanged = true;
|
|
369
369
|
updated += 1;
|
|
370
370
|
}
|
|
371
371
|
if (payload.full_sync === true) {
|