-
Notifications
You must be signed in to change notification settings - Fork 0
/
qr.js
23 lines (21 loc) · 820 Bytes
/
qr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var login = [];
var lastLoginClear = 0;
function QRClearService() {
let timer = Date.now();
if (timer - lastLoginClear > 5 * 60000) {
lastLoginClear = timer
console.log("Limpeza de codigos de login iniciada")
let removed = 0;
let x = login.length
for (let c = 0; c < login.length; c++) {
if (Date.now() - login[c].time > 5 * 60 * 1000) {
login.splice(c, 1)
removed++
}
}
console.log("Limpeza de cod. terminada: " + ((Date.now() - timer) / 1000) + "s =>" + removed + " removidos | cod. validos =>" + (((x - removed) / x) * 100) + "%")
console.log("Cod. no começo => " + x + " Codigos Atualmente => " + login.length)
}
}
exports.passport = login;
exports.QRClearService = QRClearService;