Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3516990
D7032.id23688.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7032.id23688.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7032: [desktop] Handle autoUpdate errors
Attached
Detach File
Event Timeline
Log In to Comment