chore(server): integrate DB size into startup info

This commit is contained in:
Elian Doran
2025-09-12 12:27:41 +03:00
parent 9779e706c5
commit 08a600167a
3 changed files with 20 additions and 6 deletions

View File

@@ -197,15 +197,13 @@ function optimize() {
log.info(`Optimization finished in ${Date.now() - start}ms.`);
}
function getDbSize() {
export function getDbSize() {
return sql.getValue<number>("SELECT page_count * page_size / 1000 as size FROM pragma_page_count(), pragma_page_size()");
}
function initializeDb() {
cls.init(initDbConnection);
log.info(`DB size: ${getDbSize()} KB`);
dbReady.then(() => {
if (config.General && config.General.noBackup === true) {
log.info("Disabling scheduled backups.");