Browse Source

Set up statistics gathering queue

pull/6696/head
Thomas Kaul 2 months ago
parent
commit
d012d7f4d4
  1. 37
      apps/api/src/services/queues/statistics-gathering/statistics-gathering.service.ts

37
apps/api/src/services/queues/statistics-gathering/statistics-gathering.service.ts

@ -19,39 +19,22 @@ export class StatisticsGatheringService {
) {} ) {}
public async addJobsToQueue() { public async addJobsToQueue() {
return Promise.all([ return Promise.all(
this.statisticsGatheringQueue.add( [
GATHER_STATISTICS_DOCKER_HUB_PULLS_PROCESS_JOB_NAME, 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_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_GITHUB_STARGAZERS_PROCESS_JOB_NAME,
GATHER_STATISTICS_UPTIME_PROCESS_JOB_NAME
].map((jobName) => {
return this.statisticsGatheringQueue.add(
jobName,
{}, {},
{ {
...GATHER_STATISTICS_PROCESS_JOB_OPTIONS, ...GATHER_STATISTICS_PROCESS_JOB_OPTIONS,
jobId: GATHER_STATISTICS_GITHUB_STARGAZERS_PROCESS_JOB_NAME jobId: jobName
}
),
this.statisticsGatheringQueue.add(
GATHER_STATISTICS_UPTIME_PROCESS_JOB_NAME,
{},
{
...GATHER_STATISTICS_PROCESS_JOB_OPTIONS,
jobId: GATHER_STATISTICS_UPTIME_PROCESS_JOB_NAME
} }
) );
]); })
);
} }
} }

Loading…
Cancel
Save