[user] remove one-time archiveBans job

This commit is contained in:
Andrea 2022-02-13 00:43:20 +01:00
parent 0fa8e0a1a8
commit 8eb89b623d
1 changed files with 0 additions and 19 deletions

View File

@ -74,30 +74,11 @@ async function removeWarned(db) {
}
}
async function archiveBans(db) {
console.log('--- Archiving banned accounts ---');
const users = (await db.all(`
SELECT u.id, u.username, u.email
FROM users u
WHERE u.bannedReason IS NOT NULL
`));
console.log(users.length);
for (let user of users) {
console.log('archiveBan', user);
if (!execute) { continue; }
await archiveBan(db, user);
}
}
async function cleanup() {
const db = await dbConnection();
await db.get('PRAGMA foreign_keys = ON')
await archiveBans(db); // TODO one-time only
await warnInactive(db);
await removeWarned(db);
}