hash after remote sync

This commit is contained in:
shenlong-tanwen
2025-09-06 02:35:56 +05:30
parent 03cd491197
commit 67fb9b7a2a
2 changed files with 9 additions and 10 deletions

View File

@@ -128,7 +128,6 @@ class BackgroundSyncManager {
});
}
// No need to cancel the task, as it can also be run when the user logs out
Future<void> hashAssets() {
if (_hashTask != null) {
return _hashTask!.future;

View File

@@ -161,15 +161,6 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
}
}
// Check if app is still active before hashing
if (_shouldContinueOperation()) {
try {
await backgroundManager.hashAssets();
} catch (e, stackTrace) {
_log.warning("Failed hashAssets: $e", e, stackTrace);
}
}
// Check if app is still active before remote sync
if (_shouldContinueOperation()) {
try {
@@ -187,6 +178,15 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
}
}
// Check if app is still active before hashing
if (_shouldContinueOperation()) {
try {
await backgroundManager.hashAssets();
} catch (e, stackTrace) {
_log.warning("Failed hashAssets: $e", e, stackTrace);
}
}
// Handle backup resume only if still active
if (_shouldContinueOperation()) {
final isEnableBackup = _ref.read(appSettingsServiceProvider).getSetting(AppSettingsEnum.enableBackup);