refactor(server): filter on-event handlers by worker (#14085)

This commit is contained in:
Jason Rasmussen
2024-11-20 14:08:42 -05:00
committed by GitHub
parent c6e1dbec5c
commit 876893c823
10 changed files with 24 additions and 70 deletions
+1 -4
View File
@@ -68,11 +68,8 @@ const validateRange = (value: number | undefined, min: number, max: number): Non
@Injectable()
export class MetadataService extends BaseService {
@OnEvent({ name: 'app.bootstrap' })
@OnEvent({ name: 'app.bootstrap', workers: [ImmichWorker.MICROSERVICES] })
async onBootstrap() {
if (this.worker !== ImmichWorker.MICROSERVICES) {
return;
}
this.logger.log('Bootstrapping metadata service');
await this.init();
}