From 0ad7a2f716693253e7b9080993a7255e89ad679b Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Sun, 11 Oct 2015 01:58:53 -0700 Subject: [PATCH] fix(updater): Check less frequently, stop when update ready to install --- src/browser/auto-update-manager.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/browser/auto-update-manager.coffee b/src/browser/auto-update-manager.coffee index 1a8536cc0..648254a3f 100644 --- a/src/browser/auto-update-manager.coffee +++ b/src/browser/auto-update-manager.coffee @@ -7,7 +7,7 @@ fs = require 'fs' IdleState = 'idle' CheckingState = 'checking' -DownladingState = 'downloading' +DownloadingState = 'downloading' UpdateAvailableState = 'update-available' NoUpdateAvailableState = 'no-update-available' UnsupportedState = 'unsupported' @@ -61,7 +61,7 @@ class AutoUpdateManager @setState(NoUpdateAvailableState) autoUpdater.on 'update-available', => - @setState(DownladingState) + @setState(DownloadingState) autoUpdater.on 'update-downloaded', (event, @releaseNotes, @releaseVersion) => @setState(UpdateAvailableState) @@ -69,8 +69,11 @@ class AutoUpdateManager @check(hidePopups: true) setInterval => + if @state in [UpdateAvailableState, UnsupportedState] + console.log "Skipping update check... update ready to install, or updater unavailable." + return @check(hidePopups: true) - , (1000 * 60 * 5) + , (1000 * 60 * 30) switch process.platform when 'win32'