diff --git a/src/services/stratum-v1-jobs.service.ts b/src/services/stratum-v1-jobs.service.ts index df1658b..385233a 100644 --- a/src/services/stratum-v1-jobs.service.ts +++ b/src/services/stratum-v1-jobs.service.ts @@ -162,32 +162,6 @@ export class StratumV1JobsService { return this.blocks[jobTemplateId]; } - public cleanup(clearJobs: boolean, now: number = Date.now()) { - if (clearJobs) { - this.blocks = {}; - this.jobs = {}; - return; - } - - let templatesDeleted = 0; - let jobsDeleted = 0; - - for (const templateId in this.blocks) { - if (now - this.blocks[templateId].blockData.creation > (1000 * 60 * 5)) { - delete this.blocks[templateId]; - templatesDeleted++; - } - } - - 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.`) - } - public addJob(job: MiningJob) { this.jobs[job.jobId] = job; this.latestJobId++;