mirror of
https://github.com/immich-app/immich.git
synced 2025-08-07 09:04:09 -04:00
fix: improvements to sync and upload when resuming app (#20524)
- App will now kick off hashing after local sync if the lifecycle is in resumed or active state - We now wait for hashing to complete before we kick off the upload process
This commit is contained in:
parent
10141504a2
commit
278668b8c5
@ -86,11 +86,12 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
|
||||
// Ensure proper cleanup before starting new background tasks
|
||||
try {
|
||||
await Future.wait([
|
||||
backgroundManager.syncLocal().then((_) {
|
||||
Future(() async {
|
||||
await backgroundManager.syncLocal();
|
||||
Logger("AppLifeCycleNotifier").fine("Hashing assets after syncLocal");
|
||||
// Check if app is still active before hashing
|
||||
if (state == AppLifeCycleEnum.resumed) {
|
||||
backgroundManager.hashAssets();
|
||||
if ([AppLifeCycleEnum.resumed, AppLifeCycleEnum.active].contains(state)) {
|
||||
await backgroundManager.hashAssets();
|
||||
}
|
||||
}),
|
||||
backgroundManager.syncRemote(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user