mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00: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
1 changed files with 4 additions and 3 deletions
|
|
@ -86,11 +86,12 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
|
||||||
// Ensure proper cleanup before starting new background tasks
|
// Ensure proper cleanup before starting new background tasks
|
||||||
try {
|
try {
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
backgroundManager.syncLocal().then((_) {
|
Future(() async {
|
||||||
|
await backgroundManager.syncLocal();
|
||||||
Logger("AppLifeCycleNotifier").fine("Hashing assets after syncLocal");
|
Logger("AppLifeCycleNotifier").fine("Hashing assets after syncLocal");
|
||||||
// Check if app is still active before hashing
|
// Check if app is still active before hashing
|
||||||
if (state == AppLifeCycleEnum.resumed) {
|
if ([AppLifeCycleEnum.resumed, AppLifeCycleEnum.active].contains(state)) {
|
||||||
backgroundManager.hashAssets();
|
await backgroundManager.hashAssets();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
backgroundManager.syncRemote(),
|
backgroundManager.syncRemote(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue