Skip to content

Commit

Permalink
replaced Promise.all with for loop
Browse files Browse the repository at this point in the history
the `Promise.all` creates the  deadlock causing the command `db:truncate` to throw error deadlock detected
  • Loading branch information
mdsadiqueinam authored May 11, 2024
1 parent 2a2bd22 commit 6d58ebd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/db_truncate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export default class DbTruncate extends BaseCommand {
let tables = await client.getAllTables(schemas)
tables = tables.filter((table) => !['adonis_schema', 'adonis_schema_versions'].includes(table))

await Promise.all(tables.map((table) => client.truncate(table, true)))
for (const table of tables) {
await client.truncate(table, true)
}
this.logger.success('Truncated tables successfully')
}

Expand Down

0 comments on commit 6d58ebd

Please sign in to comment.