mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Modlog: Minor fixes from smogtours conversion
This commit is contained in:
parent
a735d1fa54
commit
055a01ab89
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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')) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user