From 7972b017d2ac7e8d5933971d9d5d4ef469d217b8 Mon Sep 17 00:00:00 2001 From: ck <21735205+cyperdark@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:42:55 +0300 Subject: [PATCH] chore: limit --- packages/common/utils/config.ts | 4 ++-- packages/server/utils/counters.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/common/utils/config.ts b/packages/common/utils/config.ts index 42869a53..56ab0f15 100644 --- a/packages/common/utils/config.ts +++ b/packages/common/utils/config.ts @@ -66,7 +66,7 @@ export const config = { debugLogging: (process.env.DEBUG_LOG || '') === 'true', calculatePP: (process.env.CALCULATE_PP || '') === 'true', enableKeyOverlay: (process.env.ENABLE_KEY_OVERLAY || '') === 'true', - pollRate: Number(process.env.POLL_RATE || '500'), + pollRate: Number(process.env.POLL_RATE || '100'), preciseDataPollRate: Number( process.env.PRECISE_DATA_POLL_RATE || process.env.KEYOVERLAY_POLL_RATE || @@ -249,7 +249,7 @@ export const refreshConfig = (httpServer: any, refresh: boolean) => { config.pollRate !== pollRate || config.preciseDataPollRate !== preciseDataPollRate ) { - config.pollRate = pollRate >= 0 ? pollRate : 100; + config.pollRate = pollRate >= 100 ? pollRate : 100; config.preciseDataPollRate = preciseDataPollRate >= 0 ? preciseDataPollRate : 10; httpServer.restartWS(); diff --git a/packages/server/utils/counters.ts b/packages/server/utils/counters.ts index 946e6a69..3c03178d 100644 --- a/packages/server/utils/counters.ts +++ b/packages/server/utils/counters.ts @@ -606,7 +606,7 @@ export function buildSettings(res: http.ServerResponse) { inputHTML .replace('{TYPE}', 'number') .replace(/{ID}/gm, 'POLL_RATE') - .replace('{ADDON}', config.pollRate ? 'min="0"' : '') + .replace('{ADDON}', config.pollRate ? 'min="100"' : '') .replace('{VALUE}', `${config.pollRate}`) );