@groeponline/pi-wishcraft 0.22.1 → 0.22.2
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/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/queue/store.ts +4 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/queue/store.ts
CHANGED
|
@@ -364,12 +364,14 @@ export class PowerlineQueueStore {
|
|
|
364
364
|
* `archiveSentItems` and `writeItems` share one `now` snapshot so a sent
|
|
365
365
|
* item counted as remaining cannot be pruned on the same write.
|
|
366
366
|
*/
|
|
367
|
-
archiveSentItems(
|
|
367
|
+
archiveSentItems(
|
|
368
|
+
olderThanMs: number = this.sentRetentionMs,
|
|
369
|
+
now: number = Date.now(),
|
|
370
|
+
): {
|
|
368
371
|
archived: number;
|
|
369
372
|
remainingSent: number;
|
|
370
373
|
} {
|
|
371
374
|
return this.withStoreLock(() => {
|
|
372
|
-
const now = Date.now();
|
|
373
375
|
const items = this.list();
|
|
374
376
|
// writeItems prunes sent items older than sentRetentionMs on every write.
|
|
375
377
|
// If the requested archive window were wider than that, items in the gap
|