mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): get worker (#13927)
This commit is contained in:
parent
1d55b5bfc0
commit
5edbb93a4d
6 changed files with 22 additions and 13 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import { BadRequestException, Inject, Optional } from '@nestjs/common';
|
||||
import { BadRequestException, Inject } from '@nestjs/common';
|
||||
import sanitize from 'sanitize-filename';
|
||||
import { SystemConfig } from 'src/config';
|
||||
import { IWorker, SALT_ROUNDS } from 'src/constants';
|
||||
import { SALT_ROUNDS } from 'src/constants';
|
||||
import { StorageCore } from 'src/cores/storage.core';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { ImmichWorker } from 'src/enum';
|
||||
import { IAccessRepository } from 'src/interfaces/access.interface';
|
||||
import { IActivityRepository } from 'src/interfaces/activity.interface';
|
||||
import { IAlbumUserRepository } from 'src/interfaces/album-user.interface';
|
||||
|
|
@ -50,7 +49,6 @@ export class BaseService {
|
|||
protected storageCore: StorageCore;
|
||||
|
||||
constructor(
|
||||
@Inject(IWorker) @Optional() protected worker: ImmichWorker | undefined,
|
||||
@Inject(ILoggerRepository) protected logger: ILoggerRepository,
|
||||
@Inject(IAccessRepository) protected accessRepository: IAccessRepository,
|
||||
@Inject(IActivityRepository) protected activityRepository: IActivityRepository,
|
||||
|
|
@ -103,6 +101,10 @@ export class BaseService {
|
|||
);
|
||||
}
|
||||
|
||||
get worker() {
|
||||
return this.configRepository.getWorker();
|
||||
}
|
||||
|
||||
private get configRepos() {
|
||||
return {
|
||||
configRepo: this.configRepository,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue