mirror of
https://github.com/immich-app/immich.git
synced 2025-12-04 11:49:53 +09:00
fix: do not listen for store updates in isolates (#21947)
* dispose store on isolate cleanup * do not listen for store updates in isolates --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -89,11 +89,17 @@ abstract final class Bootstrap {
|
||||
return (isar, drift, logDb);
|
||||
}
|
||||
|
||||
static Future<void> initDomain(Isar db, Drift drift, DriftLogger logDb, {bool shouldBufferLogs = true}) async {
|
||||
static Future<void> initDomain(
|
||||
Isar db,
|
||||
Drift drift,
|
||||
DriftLogger logDb, {
|
||||
bool listenStoreUpdates = true,
|
||||
bool shouldBufferLogs = true,
|
||||
}) async {
|
||||
final isBeta = await IsarStoreRepository(db).tryGet(StoreKey.betaTimeline) ?? true;
|
||||
final IStoreRepository storeRepo = isBeta ? DriftStoreRepository(drift) : IsarStoreRepository(db);
|
||||
|
||||
await StoreService.init(storeRepository: storeRepo);
|
||||
await StoreService.init(storeRepository: storeRepo, listenUpdates: listenStoreUpdates);
|
||||
|
||||
await LogService.init(
|
||||
logRepository: LogRepository(logDb),
|
||||
|
||||
Reference in New Issue
Block a user