From 78ef48b805a5404092066d184aac985082125a17 Mon Sep 17 00:00:00 2001 From: Benjamin Wilson Date: Mon, 10 Feb 2025 00:07:14 -0500 Subject: [PATCH] logging --- src/services/stratum-v1-jobs.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/stratum-v1-jobs.service.ts b/src/services/stratum-v1-jobs.service.ts index 0a38e7b..1d7adcb 100644 --- a/src/services/stratum-v1-jobs.service.ts +++ b/src/services/stratum-v1-jobs.service.ts @@ -111,19 +111,24 @@ export class StratumV1JobsService { this.blocks = {}; this.jobs = {}; }else{ + let templatesDeleted = 0; + let jobsDeleted = 0; const now = new Date().getTime(); // Delete old templates (5 minutes) for(const templateId in this.blocks){ if(now - this.blocks[templateId].blockData.creation > (1000 * 60 * 5)){ delete this.blocks[templateId]; + templatesDeleted++; } } // Delete old jobs (5 minutes) for (const jobId in this.jobs) { if(now - this.jobs[jobId].creation > (1000 * 60 * 5)){ delete this.jobs[jobId]; + jobsDeleted++; } } + console.log(`Deleted ${templatesDeleted} templates and ${jobsDeleted} jobs.`) } this.blocks[data.blockData.id] = data; }),