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) }