mirror of
https://github.com/immich-app/immich.git
synced 2025-09-29 15:31:13 -04:00
* revert service locks * rename backgroundWorkerFgServiceProvider * refactor: parallel background worker init (#21769) * refactor: parallel background worker init * fix: hashing not running from the background engine (#21773) * init and dispose workmanager from background engine * log message contend --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com> --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com> --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
21 lines
953 B
Dart
21 lines
953 B
Dart
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/domain/utils/background_sync.dart';
|
|
import 'package:immich_mobile/providers/sync_status.provider.dart';
|
|
|
|
final backgroundSyncProvider = Provider<BackgroundSyncManager>((ref) {
|
|
final syncStatusNotifier = ref.read(syncStatusProvider.notifier);
|
|
final manager = BackgroundSyncManager(
|
|
onRemoteSyncStart: syncStatusNotifier.startRemoteSync,
|
|
onRemoteSyncComplete: syncStatusNotifier.completeRemoteSync,
|
|
onRemoteSyncError: syncStatusNotifier.errorRemoteSync,
|
|
onLocalSyncStart: syncStatusNotifier.startLocalSync,
|
|
onLocalSyncComplete: syncStatusNotifier.completeLocalSync,
|
|
onLocalSyncError: syncStatusNotifier.errorLocalSync,
|
|
onHashingStart: syncStatusNotifier.startHashJob,
|
|
onHashingComplete: syncStatusNotifier.completeHashJob,
|
|
onHashingError: syncStatusNotifier.errorHashJob,
|
|
);
|
|
ref.onDispose(manager.cancel);
|
|
return manager;
|
|
});
|