Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apps/code/src/main/services/updates/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,18 +713,18 @@ describe("UpdatesService", () => {
expect(mockUpdater.check).toHaveBeenCalled();
});

it("performs check every 24 hours", async () => {
it("performs check every hour", async () => {
await initializeService(service);

const initialCallCount = mockUpdater.check.mock.calls.length;

// Advance 24 hours
await vi.advanceTimersByTimeAsync(24 * 60 * 60 * 1000);
// Advance 1 hour
await vi.advanceTimersByTimeAsync(60 * 60 * 1000);

expect(mockUpdater.check.mock.calls.length).toBe(initialCallCount + 1);

// Advance another 24 hours
await vi.advanceTimersByTimeAsync(24 * 60 * 60 * 1000);
// Advance another hour
await vi.advanceTimersByTimeAsync(60 * 60 * 1000);

expect(mockUpdater.check.mock.calls.length).toBe(initialCallCount + 2);
});
Expand Down
2 changes: 1 addition & 1 deletion apps/code/src/main/services/updates/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class UpdatesService extends TypedEventEmitter<UpdatesEvents> {
private static readonly SERVER_HOST = "https://update.electronjs.org";
private static readonly REPO_OWNER = "PostHog";
private static readonly REPO_NAME = "code";
private static readonly CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; // 24 hours
private static readonly CHECK_INTERVAL_MS = 60 * 60 * 1000; // 1 hour
private static readonly CHECK_TIMEOUT_MS = 60 * 1000; // 1 minute timeout for checks
private static readonly DISABLE_ENV_FLAG = "ELECTRON_DISABLE_AUTO_UPDATE";
private static readonly SUPPORTED_PLATFORMS = ["darwin", "win32"];
Expand Down
Loading