Skip to content

Commit

Permalink
Fixed SyncScheduler progress reporting (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka authored Aug 25, 2023
1 parent 90b7c58 commit a72249b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Zotero/Controllers/IdleTimerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ final class IdleTimerController {
guard let self = self else { return }
self.activeProcesses += 1
UIApplication.shared.isIdleTimerDisabled = true
DDLogInfo("IdleTimerController: disable idle timer \(self.activeProcesses)")
}
}

Expand All @@ -32,6 +33,8 @@ final class IdleTimerController {

self.activeProcesses -= 1

DDLogInfo("IdleTimerController: enable idle timer \(self.activeProcesses)")

guard self.activeProcesses == 0 else { return }
UIApplication.shared.isIdleTimerDisabled = false
}
Expand Down
3 changes: 1 addition & 2 deletions Zotero/Controllers/Sync/SyncScheduler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ final class SyncScheduler: SynchronizationScheduler, WebSocketScheduler {
if let sync = sync {
// We're retrying, enqueue the new sync
self.enqueueAndStart(sync: sync)
} else if !self.syncQueue.isEmpty {
// We're not retrying, process next action
} else {
self.startNextSync()
}
})
Expand Down

0 comments on commit a72249b

Please sign in to comment.