mirror of
https://github.com/zadam/trilium.git
synced 2026-02-21 21:24:25 +01:00
chore(standalone): use async for init
Some checks failed
Checks / main (push) Has been cancelled
Deploy Standalone App / Build and Deploy App (push) Has been cancelled
Dev / Test development (push) Has been cancelled
Dev / Build Docker image (push) Has been cancelled
Dev / Check Docker build (Dockerfile) (push) Has been cancelled
Dev / Check Docker build (Dockerfile.alpine) (push) Has been cancelled
Some checks failed
Checks / main (push) Has been cancelled
Deploy Standalone App / Build and Deploy App (push) Has been cancelled
Dev / Test development (push) Has been cancelled
Dev / Build Docker image (push) Has been cancelled
Dev / Check Docker build (Dockerfile) (push) Has been cancelled
Dev / Check Docker build (Dockerfile.alpine) (push) Has been cancelled
This commit is contained in:
parent
788eaad61c
commit
4494aed1cf
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user