chore: eslint no-restricted-syntax

This commit is contained in:
Peter Jaszkowiak
2021-02-04 01:34:30 -07:00
committed by Julian Lam
parent 115d19e289
commit 5c2f0f0557
19 changed files with 124 additions and 190 deletions

View File

@@ -128,13 +128,9 @@ Analytics.writeData = async function () {
uniqueIPCount = 0;
}
if (Object.keys(counters).length > 0) {
for (const key in counters) {
if (counters.hasOwnProperty(key)) {
dbQueue.push(db.sortedSetIncrBy(`analytics:${key}`, counters[key], today.getTime()));
delete counters[key];
}
}
for (const [key, value] of Object.entries(counters)) {
dbQueue.push(db.sortedSetIncrBy(`analytics:${key}`, value, today.getTime()));
delete counters[key];
}
try {
await Promise.all(dbQueue);