mirror of
https://github.com/immich-app/immich.git
synced 2025-11-28 09:15:24 -05:00
chore: update drift (#23877)
* chore: update drift * update drift dep --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
7134dd29ca
commit
c086a65fa8
@ -177,6 +177,12 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _cleanup() async {
|
Future<void> _cleanup() async {
|
||||||
|
await runZonedGuarded(_handleCleanup, (error, stack) {
|
||||||
|
dPrint(() => "Error during background worker cleanup: $error, $stack");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _handleCleanup() async {
|
||||||
// If ref is null, it means the service was never initialized properly
|
// If ref is null, it means the service was never initialized properly
|
||||||
if (_isCleanedUp || _ref == null) {
|
if (_isCleanedUp || _ref == null) {
|
||||||
return;
|
return;
|
||||||
@ -186,11 +192,16 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
|
|||||||
_isCleanedUp = true;
|
_isCleanedUp = true;
|
||||||
final backgroundSyncManager = _ref?.read(backgroundSyncProvider);
|
final backgroundSyncManager = _ref?.read(backgroundSyncProvider);
|
||||||
final nativeSyncApi = _ref?.read(nativeSyncApiProvider);
|
final nativeSyncApi = _ref?.read(nativeSyncApiProvider);
|
||||||
|
|
||||||
|
await _drift.close();
|
||||||
|
await _driftLogger.close();
|
||||||
|
|
||||||
_ref?.dispose();
|
_ref?.dispose();
|
||||||
_ref = null;
|
_ref = null;
|
||||||
|
|
||||||
_cancellationToken.cancel();
|
_cancellationToken.cancel();
|
||||||
_logger.info("Cleaning up background worker");
|
_logger.info("Cleaning up background worker");
|
||||||
|
|
||||||
final cleanupFutures = [
|
final cleanupFutures = [
|
||||||
nativeSyncApi?.cancelHashing(),
|
nativeSyncApi?.cancelHashing(),
|
||||||
workerManagerPatch.dispose().catchError((_) async {
|
workerManagerPatch.dispose().catchError((_) async {
|
||||||
@ -199,8 +210,7 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
|
|||||||
}),
|
}),
|
||||||
LogService.I.dispose(),
|
LogService.I.dispose(),
|
||||||
Store.dispose(),
|
Store.dispose(),
|
||||||
_drift.close(),
|
|
||||||
_driftLogger.close(),
|
|
||||||
backgroundSyncManager?.cancel(),
|
backgroundSyncManager?.cancel(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -452,10 +452,11 @@ packages:
|
|||||||
drift:
|
drift:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: drift
|
path: drift
|
||||||
sha256: "14a61af39d4584faf1d73b5b35e4b758a43008cf4c0fdb0576ec8e7032c0d9a5"
|
ref: "53ef7e9f19fe8f68416251760b4b99fe43f1c575"
|
||||||
url: "https://pub.dev"
|
resolved-ref: "53ef7e9f19fe8f68416251760b4b99fe43f1c575"
|
||||||
source: hosted
|
url: "https://github.com/immich-app/drift"
|
||||||
|
source: git
|
||||||
version: "2.26.0"
|
version: "2.26.0"
|
||||||
drift_dev:
|
drift_dev:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
|
|||||||
@ -113,6 +113,13 @@ dev_dependencies:
|
|||||||
riverpod_generator: ^2.6.1
|
riverpod_generator: ^2.6.1
|
||||||
riverpod_lint: ^2.6.1
|
riverpod_lint: ^2.6.1
|
||||||
|
|
||||||
|
dependency_overrides:
|
||||||
|
drift:
|
||||||
|
git:
|
||||||
|
url: https://github.com/immich-app/drift
|
||||||
|
ref: '53ef7e9f19fe8f68416251760b4b99fe43f1c575'
|
||||||
|
path: drift/
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
assets:
|
assets:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user