Skip to content

Commit 49a9172

Browse files
authored
randomize tokens on token pool init (#9980)
1 parent 9cfd301 commit 49a9172

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/token-pooling/sql-token-persistence.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export default class SqlTokenPersistence {
1515
} else {
1616
this.pool = new pg.Pool({ connectionString: this.url })
1717
}
18-
const result = await this.pool.query(`SELECT token FROM ${this.table};`)
18+
const result = await this.pool.query(
19+
`SELECT token FROM ${this.table} ORDER BY RANDOM();`,
20+
)
1921
return result.rows.map(row => row.token)
2022
}
2123

0 commit comments

Comments
 (0)