mirror of
https://github.com/zadam/trilium.git
synced 2025-10-31 18:36:30 +01:00
correctly logging slow async requests
This commit is contained in:
@@ -47,7 +47,7 @@ async function initDbConnection() {
|
||||
}
|
||||
|
||||
async function createInitialDatabase(username, password, theme) {
|
||||
log.info("Creating initial database ...");
|
||||
log.info("Creating database schema ...");
|
||||
|
||||
if (isDbInitialized()) {
|
||||
throw new Error("DB is already initialized");
|
||||
@@ -58,6 +58,8 @@ async function createInitialDatabase(username, password, theme) {
|
||||
|
||||
let rootNote;
|
||||
|
||||
log.info("Creating root note ...");
|
||||
|
||||
sql.transactional(() => {
|
||||
sql.executeScript(schema);
|
||||
|
||||
@@ -82,11 +84,15 @@ async function createInitialDatabase(username, password, theme) {
|
||||
}).save();
|
||||
});
|
||||
|
||||
log.info("Importing demo content ...");
|
||||
|
||||
const dummyTaskContext = new TaskContext("initial-demo-import", 'import', false);
|
||||
|
||||
const zipImportService = require("./import/zip");
|
||||
await zipImportService.importZip(dummyTaskContext, demoFile, rootNote);
|
||||
|
||||
log.info("Initializing options ...");
|
||||
|
||||
sql.transactional(() => {
|
||||
const startNoteId = sql.getValue("SELECT noteId FROM branches WHERE parentNoteId = 'root' AND isDeleted = 0 ORDER BY notePosition");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user