fix(server): make system config core singleton (#4392)
* make system config core singleton * refactor * fix tests * chore: fix tests --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
@@ -223,8 +223,7 @@ describe(JobService.name, () => {
|
||||
it('should subscribe to config changes', async () => {
|
||||
await sut.registerHandlers(makeMockHandlers(false));
|
||||
|
||||
const configCore = new SystemConfigCore(newSystemConfigRepositoryMock());
|
||||
configCore.config$.next({
|
||||
SystemConfigCore.create(newSystemConfigRepositoryMock(false)).config$.next({
|
||||
job: {
|
||||
[QueueName.BACKGROUND_TASK]: { concurrency: 10 },
|
||||
[QueueName.CLIP_ENCODING]: { concurrency: 10 },
|
||||
|
||||
@@ -21,7 +21,7 @@ export class JobService {
|
||||
@Inject(ISystemConfigRepository) configRepository: ISystemConfigRepository,
|
||||
@Inject(IPersonRepository) private personRepository: IPersonRepository,
|
||||
) {
|
||||
this.configCore = new SystemConfigCore(configRepository);
|
||||
this.configCore = SystemConfigCore.create(configRepository);
|
||||
}
|
||||
|
||||
async handleCommand(queueName: QueueName, dto: JobCommandDto): Promise<JobStatusDto> {
|
||||
|
||||
Reference in New Issue
Block a user