mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
added basic DB size diagnostic log
This commit is contained in:
parent
6c62ab7a52
commit
aa58788769
@ -8,6 +8,7 @@ const sql = require('./sql');
|
||||
const cls = require('./cls');
|
||||
const optionService = require('./options');
|
||||
const Option = require('../entities/option');
|
||||
const utils = require('../services/utils');
|
||||
|
||||
async function createConnection() {
|
||||
return await sqlite.open(dataDir.DOCUMENT_PATH, {Promise});
|
||||
@ -155,6 +156,10 @@ async function dbInitialized() {
|
||||
await initDbConnection();
|
||||
}
|
||||
|
||||
dbReady.then(async () => {
|
||||
log.info("DB size: " + await sql.getValue("SELECT page_count * page_size / 1000 as size FROM pragma_page_count(), pragma_page_size()") + " KB");
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
dbReady,
|
||||
schemaExists,
|
||||
|
Loading…
x
Reference in New Issue
Block a user