Skip to content

Commit

Permalink
fix sync maps to database
Browse files Browse the repository at this point in the history
  • Loading branch information
reaby committed Jul 8, 2024
1 parent 5d454df commit afba653
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/plugins/database/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Sequelize } from 'sequelize-typescript';
import type { Player as PlayerType } from '../../playermanager';
import Plugin from '../../plugins';
import { chunkArray } from '../../utils';
import { chunkArray, sleep } from '../../utils';
import Map from '../../schemas/map.model';
import Player from '../../schemas/players.model';
import { MigrationError, SequelizeStorage, Umzug } from 'umzug';
Expand Down Expand Up @@ -109,6 +109,7 @@ export default class GenericDb extends Plugin {

async onMapListModified(data: any) {
if (data[2] === true) {
await sleep(250);
await this.syncMaps();
}
}
Expand Down

0 comments on commit afba653

Please sign in to comment.