refactor(server): immich worker (#13871)

refactor(server): immich work
This commit is contained in:
Jason Rasmussen
2024-11-01 17:19:36 -04:00
committed by GitHub
parent cdabd08139
commit fed882a28a
6 changed files with 26 additions and 35 deletions
+1 -8
View File
@@ -38,16 +38,9 @@ const asJobItem = (dto: JobCreateDto): JobItem => {
@Injectable()
export class JobService extends BaseService {
private isMicroservices = false;
@OnEvent({ name: 'app.bootstrap' })
onBootstrap(app: ArgOf<'app.bootstrap'>) {
this.isMicroservices = app === ImmichWorker.MICROSERVICES;
}
@OnEvent({ name: 'config.update', server: true })
onConfigUpdate({ newConfig: config }: ArgOf<'config.update'>) {
if (!this.isMicroservices) {
if (this.worker !== ImmichWorker.MICROSERVICES) {
return;
}