Fix update scheduling not always firing

This commit is contained in:
Zorg committed 2016-03-19 15:25:44 -04:00
1 parent 87275b23c8
commit 56a75bd4b6
2 files changed
+13 -6

No files matched your search

+8 -5
View File
@@ -340,7 +340,9 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, id
- (void)checkForUpdatesWithDriver:(id <SUUpdateDriver> )d
{
if ([self updateInProgress]) { return; }
if ([self updateInProgress]) {
return;
}
[self.userDriver invalidateUpdateCheckTimer];
@@ -353,10 +355,9 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, id
}
self.driver = d;
// If we're not given a driver at all, just schedule the next update check and bail.
if (!self.driver)
{
if (!self.driver) {
[self scheduleNextUpdateCheck];
return;
}
@@ -562,7 +563,9 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, id
// Stop checking for updates
[self cancelNextUpdateCycle];
[self.userDriver invalidateUpdateCheckTimer];
// Don't tell the user driver to invalidate the update check timer
// It could always create a new updater instance once the scheduled time occurs
// Abort any on-going updates
// A driver could be retained by another object (eg: a timer),
+5 -1
View File
@@ -218,7 +218,9 @@
[self cancelUpdateCheckStatus];
[self cancelDownloadStatus];
[self dismissInstallAndRestart];
[self invalidateUpdateCheckTimer];
// We don't invalidate the update check timer here because that's not really a part of the installation
// and we might want to keep it still alive
}
- (void)invalidate
@@ -230,6 +232,8 @@
self.installUpdateHandler = nil;
self.updateCheckStatusCompletion = nil;
[self invalidateUpdateCheckTimer];
// Dismiss the installation normally
[self dismissUpdateInstallation];
}