Skip to content

Commit 731291e

Browse files
fix(desktop): poll for updates every 4 hours, not 4 minutes (pingdotgg#28481)
Co-authored-by: Julius Marminge <[email protected]>
1 parent dfded9d commit 731291e

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎apps/desktop/src/updates/DesktopUpdates.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,26 @@ describe("DesktopUpdates", () => {
247247
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
248248
});
249249

250+
it.effect("checks shortly after startup and then every four hours", () => {
251+
const harness = makeHarness();
252+
253+
return Effect.scoped(
254+
Effect.gen(function* () {
255+
const updates = yield* DesktopUpdates.DesktopUpdates;
256+
yield* updates.configure;
257+
258+
yield* TestClock.adjust("15 seconds");
259+
assert.equal(harness.checkCount(), 1);
260+
261+
yield* TestClock.adjust("3 hours");
262+
assert.equal(harness.checkCount(), 1);
263+
264+
yield* TestClock.adjust("1 hour");
265+
assert.equal(harness.checkCount(), 2);
266+
}),
267+
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
268+
});
269+
250270
it.effect(
251271
"rejects install while a refresh check is in progress and releases the reservation",
252272
() =>

‎apps/desktop/src/updates/DesktopUpdates.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import {
6060
const CHANNEL_CHANGE_RETRY_DELAY = Duration.seconds(1);
6161
const CHANNEL_CHANGE_RETRIES = 30;
6262
const AUTO_UPDATE_STARTUP_DELAY = "15 seconds";
63-
const AUTO_UPDATE_POLL_INTERVAL = "4 minutes";
63+
const AUTO_UPDATE_POLL_INTERVAL = "4 hours";
6464
const PREPARED_INSTALL_CHECK_WAIT = Duration.seconds(90);
6565

6666
type UpdateAction = "check" | "download" | "install" | "install-recovery" | "channel";

0 commit comments

Comments
 (0)