mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: move startInitialization to inside the doWork method (#21984)
fix: android background backup Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
dcee34095b
commit
5c06ec5e0b
1 changed files with 4 additions and 6 deletions
|
|
@ -54,12 +54,6 @@ class BackgroundWorker(context: Context, params: WorkerParameters) :
|
||||||
|
|
||||||
private var foregroundFuture: ListenableFuture<Void>? = null
|
private var foregroundFuture: ListenableFuture<Void>? = null
|
||||||
|
|
||||||
init {
|
|
||||||
if (!loader.initialized()) {
|
|
||||||
loader.startInitialization(ctx)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val NOTIFICATION_CHANNEL_ID = "immich::background_worker::notif"
|
private const val NOTIFICATION_CHANNEL_ID = "immich::background_worker::notif"
|
||||||
private const val NOTIFICATION_ID = 100
|
private const val NOTIFICATION_ID = 100
|
||||||
|
|
@ -68,6 +62,10 @@ class BackgroundWorker(context: Context, params: WorkerParameters) :
|
||||||
override fun startWork(): ListenableFuture<Result> {
|
override fun startWork(): ListenableFuture<Result> {
|
||||||
Log.i(TAG, "Starting background upload worker")
|
Log.i(TAG, "Starting background upload worker")
|
||||||
|
|
||||||
|
if (!loader.initialized()) {
|
||||||
|
loader.startInitialization(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
val notificationChannel = NotificationChannel(
|
val notificationChannel = NotificationChannel(
|
||||||
NOTIFICATION_CHANNEL_ID,
|
NOTIFICATION_CHANNEL_ID,
|
||||||
NOTIFICATION_CHANNEL_ID,
|
NOTIFICATION_CHANNEL_ID,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue