diff --git a/server/modlog/index.ts b/server/modlog/index.ts index f53f96bf28..19c70578af 100644 --- a/server/modlog/index.ts +++ b/server/modlog/index.ts @@ -145,9 +145,10 @@ export class Modlog { if (hasDBInfo === 0) { // needs v2 migration - Monitor.warn(`The modlog database is being migrated to version 2; this may take a while.`); + const warnFunction = ('Monitor' in global && Monitor.warn) ? Monitor.warn : console.log; + warnFunction(`The modlog database is being migrated to version 2; this may take a while.`); await this.database.runFile(MODLOG_V2_MIGRATION_PATH); - Monitor.warn(`Modlog database migration complete.`); + warnFunction(`Modlog database migration complete.`); } this.modlogInsertionQuery = await this.database.prepare( diff --git a/tools/modlog/converter.ts b/tools/modlog/converter.ts index 3b07dc508c..0b8685afac 100644 --- a/tools/modlog/converter.ts +++ b/tools/modlog/converter.ts @@ -636,6 +636,7 @@ export class ModlogConverterTxt { } async toSQLite() { + await this.modlog.readyPromise; const files = this.isTesting ? [...this.isTesting.files.keys()] : await FS(this.textLogDir).readdir(); // Read global modlog first to avoid inserting duplicate data to database if (files.includes('modlog_global.txt')) {