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);
try {
await Promise.all(uids.map(async (uid) => {
delete uidsToClean[uid];
await cleanExpiredSessions(uid);
await revokeSessionsAboveThreshold(uid);
delete uidsToClean[uid];
}));
} catch (err) {
winston.error(err.stack);