Fix ban process not using dbconn for delete query
parent
68f767b28d
commit
54a7145630
|
@ -310,7 +310,9 @@ async function processBannedUsers() {
|
||||||
var dbconn = await db.connect();
|
var dbconn = await db.connect();
|
||||||
try {
|
try {
|
||||||
await dbconn.query('BEGIN');
|
await dbconn.query('BEGIN');
|
||||||
db.query("DELETE FROM bans");
|
dbconn.query("DELETE FROM bans");
|
||||||
|
log(LogLevel.DEBUG,"Ban list:")
|
||||||
|
log(LogLevel.DEBUG,JSON.stringify(response.data,null,2));
|
||||||
for (var ban of response.data) {
|
for (var ban of response.data) {
|
||||||
if (ban.expires_at == '') dbconn.query(Object.assign(queries.insertBan,{ values: [ban.user_id] }))
|
if (ban.expires_at == '') dbconn.query(Object.assign(queries.insertBan,{ values: [ban.user_id] }))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue