mirror of
https://github.com/immich-app/immich.git
synced 2025-12-08 08:13:55 +09:00
feat(server/web) Add manual job trigger mechanism to the web (#767)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { generateChecksumQueueName } from '@app/job';
|
||||
import { QueueNameEnum } from '@app/job';
|
||||
import { InjectQueue } from '@nestjs/bull';
|
||||
import { Injectable, OnModuleInit } from '@nestjs/common';
|
||||
import { Queue } from 'bull';
|
||||
@@ -6,14 +6,18 @@ import { randomUUID } from 'node:crypto';
|
||||
|
||||
@Injectable()
|
||||
export class MicroservicesService implements OnModuleInit {
|
||||
constructor (
|
||||
@InjectQueue(generateChecksumQueueName)
|
||||
constructor(
|
||||
@InjectQueue(QueueNameEnum.CHECKSUM_GENERATION)
|
||||
private generateChecksumQueue: Queue,
|
||||
) {}
|
||||
|
||||
async onModuleInit() {
|
||||
await this.generateChecksumQueue.add({}, {
|
||||
jobId: randomUUID(), delay: 10000 // wait for migration
|
||||
});
|
||||
await this.generateChecksumQueue.add(
|
||||
{},
|
||||
{
|
||||
jobId: randomUUID(),
|
||||
delay: 10000, // wait for migration
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user