将user数据导入变更为串行,防止一些特殊情况下的userid冲突

This commit is contained in:
Kokomi 2023-06-07 05:37:52 +08:00
parent 86b2b7d60a
commit 83ba3482bd
1 changed files with 1 additions and 1 deletions

View File

@ -344,7 +344,7 @@ export default class User extends base {
await sequelize.query(`delete from UserGames where userId is null or data is null`, {}) await sequelize.query(`delete from UserGames where userId is null or data is null`, {})
let games = await UserGameDB.findAll() let games = await UserGameDB.findAll()
let count = 0 let count = 0
await Data.asyncPool(20, games, async (game) => { await Data.forEach(games, async (game) => {
if (!game.userId) { if (!game.userId) {
game.destroy() game.destroy()
return true return true