Skip consumers if no config is provided
This commit is contained in:
@@ -19,9 +19,9 @@ export abstract class Consumer<C extends ConsumerConfig> {
|
||||
}
|
||||
|
||||
consume(config: Config, date: Dayjs, measurement: Measurement): void {
|
||||
const cfg = config.consumers[this.name] as Partial<C>;
|
||||
const cfg = config.consumers?.[this.name] as Partial<C>;
|
||||
|
||||
if (cfg.enable !== true) {
|
||||
if (cfg?.enable !== true) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user