From 4d01ece286852d9f98a0db2f612068c2cf0912ac Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Sat, 10 Sep 2022 14:16:17 -0400 Subject: [PATCH] refactor: fix remaining lints in backend daemons --- packages/backend/src/daemons/queue-stats.ts | 2 +- packages/backend/src/daemons/server-stats.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/daemons/queue-stats.ts b/packages/backend/src/daemons/queue-stats.ts index 8d7736058..baabadfff 100644 --- a/packages/backend/src/daemons/queue-stats.ts +++ b/packages/backend/src/daemons/queue-stats.ts @@ -9,7 +9,7 @@ const interval = 10000; * Report queue stats regularly */ export function queueStats(): void { - const log = [] as any[]; + const log: Record>[] = []; ev.on('requestQueueStatsLog', x => { ev.emit(`queueStatsLog:${x.id}`, log.slice(0, x.length || 50)); diff --git a/packages/backend/src/daemons/server-stats.ts b/packages/backend/src/daemons/server-stats.ts index 29546d6ab..573e2919e 100644 --- a/packages/backend/src/daemons/server-stats.ts +++ b/packages/backend/src/daemons/server-stats.ts @@ -13,7 +13,7 @@ const round = (num: number): number => Math.round(num * 10) / 10; * Report server stats regularly */ export function serverStats(): void { - const log = [] as any[]; + const log: Record | number>[] = []; ev.on('requestServerStatsLog', x => { ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length || 50)); @@ -52,7 +52,7 @@ export function serverStats(): void { // CPU STAT function cpuUsage(): Promise { - return new Promise((res, rej) => { + return new Promise((res) => { osUtils.cpuUsage((cpuUsage) => { res(cpuUsage); });