feat: init sqlite for wikiWorker

This commit is contained in:
linonetwo 2023-05-31 23:12:36 +08:00
parent 18606a3553
commit cf7fae2dcf
16 changed files with 351 additions and 33 deletions

View file

@ -12,6 +12,7 @@ import { tiddlywikiLanguagesMap } from '@/constants/languages';
import { WikiCreationMethod } from '@/constants/wikiCreation';
import type { IAuthenticationService } from '@services/auth/interface';
import { lazyInject } from '@services/container';
import { IDatabaseService } from '@services/database/interface';
import type { IGitService } from '@services/git/interface';
import getFromRenderer from '@services/libs/getFromRenderer';
import { i18n } from '@services/libs/i18n';
@ -41,6 +42,9 @@ export class WorkspaceView implements IWorkspaceViewService {
@lazyInject(serviceIdentifier.Git)
private readonly gitService!: IGitService;
@lazyInject(serviceIdentifier.Database)
private readonly databaseService!: IDatabaseService;
@lazyInject(serviceIdentifier.Wiki)
private readonly wikiService!: IWikiService;
@ -203,6 +207,8 @@ export class WorkspaceView implements IWorkspaceViewService {
}
}
}
// after all init finished, create cache database if there is no one
await this.databaseService.initializeForWorkspace(workspace.id);
}
public async updateLastUrl(