refactor: move delete call

This commit is contained in:
Barış Soner Uşaklı
2024-06-26 14:32:37 -04:00
parent 26feb2bbf8
commit 65a91ea5e5

View File

@@ -19,9 +19,9 @@ module.exports = function (User) {
const uids = Object.keys(uidsToClean); const uids = Object.keys(uidsToClean);
try { try {
await Promise.all(uids.map(async (uid) => { await Promise.all(uids.map(async (uid) => {
delete uidsToClean[uid];
await cleanExpiredSessions(uid); await cleanExpiredSessions(uid);
await revokeSessionsAboveThreshold(uid); await revokeSessionsAboveThreshold(uid);
delete uidsToClean[uid];
})); }));
} catch (err) { } catch (err) {
winston.error(err.stack); winston.error(err.stack);