From d012d7f4d4827544bcc792a777503580c358b564 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:37:29 +0200 Subject: [PATCH] Set up statistics gathering queue --- .../statistics-gathering.service.ts | 45 ++++++------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/apps/api/src/services/queues/statistics-gathering/statistics-gathering.service.ts b/apps/api/src/services/queues/statistics-gathering/statistics-gathering.service.ts index 34400b1f5..68c674688 100644 --- a/apps/api/src/services/queues/statistics-gathering/statistics-gathering.service.ts +++ b/apps/api/src/services/queues/statistics-gathering/statistics-gathering.service.ts @@ -19,39 +19,22 @@ export class StatisticsGatheringService { ) {} public async addJobsToQueue() { - return Promise.all([ - this.statisticsGatheringQueue.add( + return Promise.all( + [ GATHER_STATISTICS_DOCKER_HUB_PULLS_PROCESS_JOB_NAME, - {}, - { - ...GATHER_STATISTICS_PROCESS_JOB_OPTIONS, - jobId: GATHER_STATISTICS_DOCKER_HUB_PULLS_PROCESS_JOB_NAME - } - ), - this.statisticsGatheringQueue.add( GATHER_STATISTICS_GITHUB_CONTRIBUTORS_PROCESS_JOB_NAME, - {}, - { - ...GATHER_STATISTICS_PROCESS_JOB_OPTIONS, - jobId: GATHER_STATISTICS_GITHUB_CONTRIBUTORS_PROCESS_JOB_NAME - } - ), - this.statisticsGatheringQueue.add( GATHER_STATISTICS_GITHUB_STARGAZERS_PROCESS_JOB_NAME, - {}, - { - ...GATHER_STATISTICS_PROCESS_JOB_OPTIONS, - jobId: GATHER_STATISTICS_GITHUB_STARGAZERS_PROCESS_JOB_NAME - } - ), - this.statisticsGatheringQueue.add( - GATHER_STATISTICS_UPTIME_PROCESS_JOB_NAME, - {}, - { - ...GATHER_STATISTICS_PROCESS_JOB_OPTIONS, - jobId: GATHER_STATISTICS_UPTIME_PROCESS_JOB_NAME - } - ) - ]); + GATHER_STATISTICS_UPTIME_PROCESS_JOB_NAME + ].map((jobName) => { + return this.statisticsGatheringQueue.add( + jobName, + {}, + { + ...GATHER_STATISTICS_PROCESS_JOB_OPTIONS, + jobId: jobName + } + ); + }) + ); } }