From 432f5c432531ab8a877442cf7f4e9007260761c0 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Sun, 30 Jul 2023 19:33:02 -0400 Subject: [PATCH] tweaks --- src/app.controller.ts | 4 ++-- src/models/StratumV1ClientStatistics.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app.controller.ts b/src/app.controller.ts index a992f63..f8e5156 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -33,8 +33,8 @@ export class AppController { const chartData = await this.clientStatisticsService.getChartDataForSite(); - await this.cacheManager.set(CACHE_KEY, chartData, 600); - + //5 min + await this.cacheManager.set(CACHE_KEY, chartData, 5 * 60 * 1000); return { chartData, diff --git a/src/models/StratumV1ClientStatistics.ts b/src/models/StratumV1ClientStatistics.ts index dd2cf78..fa999a8 100644 --- a/src/models/StratumV1ClientStatistics.ts +++ b/src/models/StratumV1ClientStatistics.ts @@ -58,7 +58,7 @@ export class StratumV1ClientStatistics { const targetDifficulty = difficultyPerSecond * TARGET_SUBMISSION_PER_SECOND; - if (clientDifficulty << 1 < targetDifficulty || clientDifficulty >> 1 > targetDifficulty) { + if ((clientDifficulty * 2) < targetDifficulty || (clientDifficulty / 2) > targetDifficulty) { return this.nearestPowerOfTwo(targetDifficulty) }