mirror of
https://github.com/immich-app/immich.git
synced 2025-11-01 19:17:12 -04:00
* refactor(server): job repository * refactor: job repository * chore: generate open-api * fix: job panel * Remove incorrect subtitle Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
17 lines
530 B
TypeScript
17 lines
530 B
TypeScript
import { Inject, Injectable, OnModuleInit } from '@nestjs/common';
|
|
import { IJobRepository, JobName } from '@app/domain';
|
|
|
|
const sleep = (ms: number) => new Promise<void>((resolve) => setTimeout(() => resolve(), ms));
|
|
|
|
@Injectable()
|
|
export class MicroservicesService implements OnModuleInit {
|
|
constructor(@Inject(IJobRepository) private jobRepository: IJobRepository) {}
|
|
|
|
async onModuleInit() {
|
|
// wait for migration
|
|
await sleep(10_000);
|
|
|
|
await this.jobRepository.add({ name: JobName.CHECKSUM_GENERATION });
|
|
}
|
|
}
|