Page MenuHomePhorge

D6683.1767449617.diff
No OneTemporary

Size
974 B
Referenced Files
None
Subscribers
None

D6683.1767449617.diff

diff --git a/desktop/src/auto-update.js b/desktop/src/auto-update.js
--- a/desktop/src/auto-update.js
+++ b/desktop/src/auto-update.js
@@ -11,13 +11,23 @@
// Check for new updates every 10 minutes
const updateIntervalMs = 10 * 60_000;
+ let updateCheckSchedule = null;
const scheduleCheckForUpdates = () => {
- setTimeout(() => autoUpdater.checkForUpdates(), updateIntervalMs);
+ if (updateCheckSchedule) {
+ clearInterval(updateCheckSchedule);
+ }
+ updateCheckSchedule = setInterval(
+ () => autoUpdater.checkForUpdates(),
+ updateIntervalMs,
+ );
};
scheduleCheckForUpdates();
- autoUpdater.on('update-not-available', scheduleCheckForUpdates);
+ autoUpdater.on('update-available', () => {
+ clearInterval(updateCheckSchedule);
+ updateCheckSchedule = null;
+ });
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
autoUpdater.setFeedURL({ url: getUpdateUrl(releaseName) });

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 3, 2:13 PM (5 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5889175
Default Alt Text
D6683.1767449617.diff (974 B)

Event Timeline