Page MenuHomePhabricator

D7032.id23688.diff
No OneTemporary

D7032.id23688.diff

diff --git a/desktop/flow-typed/npm/electron_v22.0.0.js b/desktop/flow-typed/npm/electron_v22.0.0.js
--- a/desktop/flow-typed/npm/electron_v22.0.0.js
+++ b/desktop/flow-typed/npm/electron_v22.0.0.js
@@ -184,6 +184,7 @@
}
declare type AutoUpdaterEvents = {
+ 'error': Error => void,
'checking-for-update': () => void,
'update-available': () => void,
'update-not-available': () => void,
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,8 +11,14 @@
// Check for new updates every 10 minutes
const updateIntervalMs = 10 * 60_000;
+ let currentTimeout = null;
const scheduleCheckForUpdates = () => {
- setTimeout(() => autoUpdater.checkForUpdates(), updateIntervalMs);
+ if (!currentTimeout) {
+ currentTimeout = setTimeout(() => {
+ autoUpdater.checkForUpdates();
+ currentTimeout = null;
+ }, updateIntervalMs);
+ }
};
scheduleCheckForUpdates();
@@ -24,5 +30,10 @@
scheduleCheckForUpdates();
});
+ autoUpdater.on('error', error => {
+ console.error(error);
+ scheduleCheckForUpdates();
+ });
+
ipcMain.on('update-to-new-version', () => autoUpdater.quitAndInstall());
}

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 4:01 PM (14 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2695261
Default Alt Text
D7032.id23688.diff (1 KB)

Event Timeline