mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +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 cls = require('./cls'); | ||||||
| const optionService = require('./options'); | const optionService = require('./options'); | ||||||
| const Option = require('../entities/option'); | const Option = require('../entities/option'); | ||||||
|  | const utils = require('../services/utils'); | ||||||
|  |  | ||||||
| async function createConnection() { | async function createConnection() { | ||||||
|     return await sqlite.open(dataDir.DOCUMENT_PATH, {Promise}); |     return await sqlite.open(dataDir.DOCUMENT_PATH, {Promise}); | ||||||
| @@ -155,6 +156,10 @@ async function dbInitialized() { | |||||||
|     await initDbConnection(); |     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 = { | module.exports = { | ||||||
|     dbReady, |     dbReady, | ||||||
|     schemaExists, |     schemaExists, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user