mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): notification events (#10754)
This commit is contained in:
parent
0b88bef157
commit
81d12c0586
10 changed files with 92 additions and 69 deletions
|
|
@ -20,7 +20,7 @@ import {
|
|||
IEventRepository,
|
||||
OnEvents,
|
||||
ServerEvent,
|
||||
SystemConfigUpdate,
|
||||
SystemConfigUpdateEvent,
|
||||
} from 'src/interfaces/event.interface';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.interface';
|
||||
|
|
@ -42,11 +42,7 @@ export class SystemConfigService implements OnEvents {
|
|||
@EventHandlerOptions({ priority: -100 })
|
||||
async onBootstrapEvent() {
|
||||
const config = await this.core.getConfig({ withCache: false });
|
||||
this.config$.next(config);
|
||||
}
|
||||
|
||||
get config$() {
|
||||
return this.core.config$;
|
||||
this.core.config$.next(config);
|
||||
}
|
||||
|
||||
async getConfig(): Promise<SystemConfigDto> {
|
||||
|
|
@ -58,7 +54,7 @@ export class SystemConfigService implements OnEvents {
|
|||
return mapConfig(defaults);
|
||||
}
|
||||
|
||||
onConfigValidateEvent({ newConfig, oldConfig }: SystemConfigUpdate) {
|
||||
onConfigValidateEvent({ newConfig, oldConfig }: SystemConfigUpdateEvent) {
|
||||
if (!_.isEqual(instanceToPlain(newConfig.logging), oldConfig.logging) && this.getEnvLogLevel()) {
|
||||
throw new Error('Logging cannot be changed while the environment variable IMMICH_LOG_LEVEL is set.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue