mirror of
https://github.com/zadam/trilium.git
synced 2026-08-31 04:15:49 +02:00
chore(standalone): use async for init
This commit is contained in:
@@ -98,7 +98,7 @@ async function initialize(): Promise<void> {
|
||||
|
||||
console.log("[Worker] Loading @triliumnext/core...");
|
||||
coreModule = await import("@triliumnext/core");
|
||||
coreModule.initializeCore({
|
||||
await coreModule.initializeCore({
|
||||
executionContext: new BrowserExecutionContext(),
|
||||
crypto: new BrowserCryptoProvider(),
|
||||
messaging: messagingProvider,
|
||||
|
||||
@@ -18,7 +18,7 @@ async function startApplication() {
|
||||
const dbProvider = new BetterSqlite3Provider();
|
||||
dbProvider.loadFromFile(DOCUMENT_PATH, config.General.readOnly);
|
||||
|
||||
initializeCore({
|
||||
await initializeCore({
|
||||
dbConfig: {
|
||||
provider: dbProvider,
|
||||
isReadOnly: config.General.readOnly,
|
||||
|
||||
@@ -68,7 +68,7 @@ export type { NoteParams } from "./services/notes";
|
||||
export * as sanitize from "./services/sanitizer";
|
||||
export * as routes from "./routes";
|
||||
|
||||
export function initializeCore({ dbConfig, executionContext, crypto, translations, messaging, extraAppInfo }: {
|
||||
export async function initializeCore({ dbConfig, executionContext, crypto, translations, messaging, extraAppInfo }: {
|
||||
dbConfig: SqlServiceParams,
|
||||
executionContext: ExecutionContext,
|
||||
crypto: CryptoProvider,
|
||||
@@ -80,10 +80,10 @@ export function initializeCore({ dbConfig, executionContext, crypto, translation
|
||||
};
|
||||
}) {
|
||||
initLog();
|
||||
await initTranslations(translations);
|
||||
initCrypto(crypto);
|
||||
initSql(new SqlService(dbConfig, getLog()));
|
||||
initContext(executionContext);
|
||||
initTranslations(translations);
|
||||
Object.assign(appInfo, extraAppInfo);
|
||||
if (messaging) {
|
||||
initMessaging(messaging);
|
||||
|
||||
Reference in New Issue
Block a user