migrate hashes from remote asset table

This commit is contained in:
shenlong-tanwen
2025-09-05 04:15:16 +05:30
parent b11ea52704
commit 5236a72fb3
12 changed files with 78 additions and 62 deletions
@@ -207,9 +207,10 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
}
Future<void> _syncAssets({Duration? hashTimeout}) async {
final futures = <Future<void>>[];
final localSyncFuture = _ref.read(backgroundSyncProvider).syncLocal().then((_) async {
await (
_ref.read(backgroundSyncProvider).syncLocal(),
_ref.read(backgroundSyncProvider).syncRemote(),
).wait.whenComplete(() async {
if (_isCleanedUp) {
return;
}
@@ -226,11 +227,6 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
return hashFuture;
});
futures.add(localSyncFuture);
futures.add(_ref.read(backgroundSyncProvider).syncRemote());
await Future.wait(futures);
}
}