mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	added basic DB size diagnostic log
This commit is contained in:
		| @@ -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, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user