@openviking/dsh-memory-plugin 0.5.27 → 0.5.28
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/package.json +1 -1
- package/shared/pending-queue.mjs +5 -1
package/package.json
CHANGED
package/shared/pending-queue.mjs
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* (default: 50)
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { mkdir, readdir, readFile, rename, writeFile, unlink, stat, chmod } from "node:fs/promises";
|
|
24
|
+
import { mkdir, readdir, readFile, rename, writeFile, unlink, stat, chmod, utimes } from "node:fs/promises";
|
|
25
25
|
import { createHash } from "node:crypto";
|
|
26
26
|
import { join } from "node:path";
|
|
27
27
|
import { homedir } from "node:os";
|
|
@@ -268,6 +268,10 @@ export async function claimForReplay(filename) {
|
|
|
268
268
|
const dir = getPendingDir();
|
|
269
269
|
const claimed = processingFilename(filename);
|
|
270
270
|
try {
|
|
271
|
+
// Recovery measures claim age, not how long the item waited offline.
|
|
272
|
+
// Refresh before publishing .processing so recovery cannot see an old mtime.
|
|
273
|
+
const now = new Date();
|
|
274
|
+
await utimes(join(dir, filename), now, now);
|
|
271
275
|
await rename(join(dir, filename), join(dir, claimed));
|
|
272
276
|
return claimed;
|
|
273
277
|
} catch {
|