fix: config updates not applying for job and storage template service (#14074)

This commit is contained in:
Zack Pollard
2024-11-11 12:50:09 +00:00
committed by GitHub
parent f1c9b763cf
commit d4ca7d0075
4 changed files with 17 additions and 9 deletions
+6 -2
View File
@@ -39,8 +39,7 @@ const asJobItem = (dto: JobCreateDto): JobItem => {
@Injectable()
export class JobService extends BaseService {
@OnEvent({ name: 'config.init' })
@OnEvent({ name: 'config.update', server: true })
onConfigInitOrUpdate({ newConfig: config }: ArgOf<'config.init'>) {
onConfigInit({ newConfig: config }: ArgOf<'config.init'>) {
if (this.worker !== ImmichWorker.MICROSERVICES) {
return;
}
@@ -56,6 +55,11 @@ export class JobService extends BaseService {
}
}
@OnEvent({ name: 'config.update', server: true })
onConfigUpdate({ newConfig: config }: ArgOf<'config.update'>) {
this.onConfigInit({ newConfig: config });
}
async create(dto: JobCreateDto): Promise<void> {
await this.jobRepository.queue(asJobItem(dto));
}