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,12 +1,12 @@
|
|||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { StorageCore, StorageFolder } from 'src/cores/storage.core';
|
||||
import { OnEvents } from 'src/interfaces/event.interface';
|
||||
import { OnEmit } from 'src/decorators';
|
||||
import { IDeleteFilesJob, JobStatus } from 'src/interfaces/job.interface';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { IStorageRepository } from 'src/interfaces/storage.interface';
|
||||
|
||||
@Injectable()
|
||||
export class StorageService implements OnEvents {
|
||||
export class StorageService {
|
||||
constructor(
|
||||
@Inject(IStorageRepository) private storageRepository: IStorageRepository,
|
||||
@Inject(ILoggerRepository) private logger: ILoggerRepository,
|
||||
|
|
@ -14,7 +14,8 @@ export class StorageService implements OnEvents {
|
|||
this.logger.setContext(StorageService.name);
|
||||
}
|
||||
|
||||
onBootstrapEvent() {
|
||||
@OnEmit({ event: 'onBootstrap' })
|
||||
onBootstrap() {
|
||||
const libraryBase = StorageCore.getBaseFolder(StorageFolder.LIBRARY);
|
||||
this.storageRepository.mkdirSync(libraryBase);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue