mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor: job names (#1343)
* refactor: job names * refactor: remove jobId
This commit is contained in:
@@ -1,23 +1,17 @@
|
||||
import { QueueNameEnum } from '@app/job';
|
||||
import { QueueName } from '@app/job';
|
||||
import { InjectQueue } from '@nestjs/bull';
|
||||
import { Injectable, OnModuleInit } from '@nestjs/common';
|
||||
import { Queue } from 'bull';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
|
||||
@Injectable()
|
||||
export class MicroservicesService implements OnModuleInit {
|
||||
constructor(
|
||||
@InjectQueue(QueueNameEnum.CHECKSUM_GENERATION)
|
||||
@InjectQueue(QueueName.CHECKSUM_GENERATION)
|
||||
private generateChecksumQueue: Queue,
|
||||
) {}
|
||||
|
||||
async onModuleInit() {
|
||||
await this.generateChecksumQueue.add(
|
||||
{},
|
||||
{
|
||||
jobId: randomUUID(),
|
||||
delay: 10000, // wait for migration
|
||||
},
|
||||
);
|
||||
// wait for migration
|
||||
await this.generateChecksumQueue.add({}, { delay: 10000 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user