mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: local sync task never runs on iOS (#21491)
* fix: local sync task never runs on iOS * chore: rename ios register method * refactor from using dart callback to dart entrypoint + more logs * check if file exists before hashing * reschedule local sync task * chore: rename background worker logger * refactor: move file exists check inside repo --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
4f7702c6bf
commit
674faf2e57
12 changed files with 218 additions and 152 deletions
|
|
@ -74,7 +74,7 @@ class BackgroundWorkerPigeonCodec: FlutterStandardMessageCodec, @unchecked Senda
|
|||
/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
|
||||
protocol BackgroundWorkerFgHostApi {
|
||||
func enableSyncWorker() throws
|
||||
func enableUploadWorker(callbackHandle: Int64) throws
|
||||
func enableUploadWorker() throws
|
||||
func disableUploadWorker() throws
|
||||
}
|
||||
|
||||
|
|
@ -99,11 +99,9 @@ class BackgroundWorkerFgHostApiSetup {
|
|||
}
|
||||
let enableUploadWorkerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.immich_mobile.BackgroundWorkerFgHostApi.enableUploadWorker\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec)
|
||||
if let api = api {
|
||||
enableUploadWorkerChannel.setMessageHandler { message, reply in
|
||||
let args = message as! [Any?]
|
||||
let callbackHandleArg = args[0] as! Int64
|
||||
enableUploadWorkerChannel.setMessageHandler { _, reply in
|
||||
do {
|
||||
try api.enableUploadWorker(callbackHandle: callbackHandleArg)
|
||||
try api.enableUploadWorker()
|
||||
reply(wrapResult(nil))
|
||||
} catch {
|
||||
reply(wrapError(error))
|
||||
|
|
@ -130,6 +128,7 @@ class BackgroundWorkerFgHostApiSetup {
|
|||
/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
|
||||
protocol BackgroundWorkerBgHostApi {
|
||||
func onInitialized() throws
|
||||
func close() throws
|
||||
}
|
||||
|
||||
/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
|
||||
|
|
@ -151,6 +150,19 @@ class BackgroundWorkerBgHostApiSetup {
|
|||
} else {
|
||||
onInitializedChannel.setMessageHandler(nil)
|
||||
}
|
||||
let closeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.immich_mobile.BackgroundWorkerBgHostApi.close\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec)
|
||||
if let api = api {
|
||||
closeChannel.setMessageHandler { _, reply in
|
||||
do {
|
||||
try api.close()
|
||||
reply(wrapResult(nil))
|
||||
} catch {
|
||||
reply(wrapError(error))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
closeChannel.setMessageHandler(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue