amalgm 0.1.210 → 0.1.211
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
CHANGED
|
@@ -685,3 +685,27 @@ test('a restarted wall publishes once even when the project is already attached'
|
|
|
685
685
|
> before.publishes + before.publishSkips,
|
|
686
686
|
);
|
|
687
687
|
});
|
|
688
|
+
|
|
689
|
+
test('the periodic project check retries an unsent wall', async () => {
|
|
690
|
+
const originalSetInterval = global.setInterval;
|
|
691
|
+
let periodicCheck = null;
|
|
692
|
+
global.setInterval = (callback) => {
|
|
693
|
+
periodicCheck = callback;
|
|
694
|
+
return { unref() {} };
|
|
695
|
+
};
|
|
696
|
+
try {
|
|
697
|
+
startWallService();
|
|
698
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
699
|
+
const before = wallStats();
|
|
700
|
+
periodicCheck();
|
|
701
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
702
|
+
const after = wallStats();
|
|
703
|
+
assert.ok(
|
|
704
|
+
after.publishes + after.publishSkips
|
|
705
|
+
> before.publishes + before.publishSkips,
|
|
706
|
+
);
|
|
707
|
+
} finally {
|
|
708
|
+
stopWallService();
|
|
709
|
+
global.setInterval = originalSetInterval;
|
|
710
|
+
}
|
|
711
|
+
});
|
|
@@ -714,7 +714,10 @@ function startWallService() {
|
|
|
714
714
|
schedulePublish();
|
|
715
715
|
}
|
|
716
716
|
});
|
|
717
|
-
service.ensureInterval = setInterval(() =>
|
|
717
|
+
service.ensureInterval = setInterval(() => {
|
|
718
|
+
ensureProjects().catch(() => {});
|
|
719
|
+
schedulePublish();
|
|
720
|
+
}, ENSURE_INTERVAL_MS);
|
|
718
721
|
service.ensureInterval.unref?.();
|
|
719
722
|
ensureProjects().catch(() => {});
|
|
720
723
|
schedulePublish();
|