fix: cleanup logger DB in isolates (#20730)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-08-07 03:27:17 +05:30 committed by GitHub
parent 68b617130a
commit 9c8c52874a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 25 additions and 28 deletions

View file

@ -47,14 +47,11 @@ abstract final class Bootstrap {
);
}
static Future<void> initDomain(Isar db, {bool shouldBufferLogs = true}) async {
// load drift dbs
final loggerDb = DriftLogger();
static Future<void> initDomain(Isar db, DriftLogger logDb, {bool shouldBufferLogs = true}) async {
await StoreService.init(storeRepository: IsarStoreRepository(db));
await LogService.init(
logRepository: LogRepository(loggerDb),
logRepository: LogRepository(logDb),
storeRepository: IsarStoreRepository(db),
shouldBuffer: shouldBufferLogs,
);