mirror of
https://github.com/DefinedNet/mobile_nebula.git
synced 2025-09-05 10:46:04 +00:00
Mark closures in DNUpdate
as @Sendable
This commit is contained in:
parent
8e9b5fcc4a
commit
df4c3a51b8
1 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ class DNUpdater {
|
||||||
private let timer = RepeatingTimer(timeInterval: 15 * 60) // 15 * 60 is 15 minutes
|
private let timer = RepeatingTimer(timeInterval: 15 * 60) // 15 * 60 is 15 minutes
|
||||||
private let log = Logger(subsystem: "net.defined.mobileNebula", category: "DNUpdater")
|
private let log = Logger(subsystem: "net.defined.mobileNebula", category: "DNUpdater")
|
||||||
|
|
||||||
func updateAll(onUpdate: @escaping (Site) -> Void) {
|
func updateAll(onUpdate: @Sendable @escaping (Site) -> Void) {
|
||||||
_ = SiteList { (sites, _) -> Void in
|
_ = SiteList { (sites, _) -> Void in
|
||||||
// NEVPN seems to force us onto the main thread and we are about to make network calls that
|
// NEVPN seems to force us onto the main thread and we are about to make network calls that
|
||||||
// could block for a while. Push ourselves onto another thread to avoid blocking the UI.
|
// could block for a while. Push ourselves onto another thread to avoid blocking the UI.
|
||||||
|
@ -23,21 +23,21 @@ class DNUpdater {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateAllLoop(onUpdate: @escaping (Site) -> Void) {
|
func updateAllLoop(onUpdate: @Sendable @escaping (Site) -> Void) {
|
||||||
timer.eventHandler = {
|
timer.eventHandler = {
|
||||||
self.updateAll(onUpdate: onUpdate)
|
self.updateAll(onUpdate: onUpdate)
|
||||||
}
|
}
|
||||||
timer.resume()
|
timer.resume()
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateSingleLoop(site: Site, onUpdate: @escaping (Site) -> Void) {
|
func updateSingleLoop(site: Site, onUpdate: @Sendable @escaping (Site) -> Void) {
|
||||||
timer.eventHandler = {
|
timer.eventHandler = {
|
||||||
self.updateSite(site: site, onUpdate: onUpdate)
|
self.updateSite(site: site, onUpdate: onUpdate)
|
||||||
}
|
}
|
||||||
timer.resume()
|
timer.resume()
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateSite(site: Site, onUpdate: @escaping (Site) -> Void) {
|
func updateSite(site: Site, onUpdate: @Sendable @escaping (Site) -> Void) {
|
||||||
do {
|
do {
|
||||||
if !site.managed {
|
if !site.managed {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue