mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor: server emit events (#11780)
This commit is contained in:
parent
32c05ea950
commit
433c7ab01d
27 changed files with 222 additions and 182 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvents } from 'src/interfaces/event.interface';
|
||||
import { OnEmit } from 'src/decorators';
|
||||
import { ArgOf } from 'src/interfaces/event.interface';
|
||||
import { IDeleteFilesJob, JobName } from 'src/interfaces/job.interface';
|
||||
import { AssetService } from 'src/services/asset.service';
|
||||
import { AuditService } from 'src/services/audit.service';
|
||||
|
|
@ -19,7 +20,7 @@ import { VersionService } from 'src/services/version.service';
|
|||
import { otelShutdown } from 'src/utils/instrumentation';
|
||||
|
||||
@Injectable()
|
||||
export class MicroservicesService implements OnEvents {
|
||||
export class MicroservicesService {
|
||||
constructor(
|
||||
private auditService: AuditService,
|
||||
private assetService: AssetService,
|
||||
|
|
@ -38,7 +39,8 @@ export class MicroservicesService implements OnEvents {
|
|||
private versionService: VersionService,
|
||||
) {}
|
||||
|
||||
async onBootstrapEvent(app: 'api' | 'microservices') {
|
||||
@OnEmit({ event: 'onBootstrap' })
|
||||
async onBootstrap(app: ArgOf<'onBootstrap'>) {
|
||||
if (app !== 'microservices') {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue