chore: make cache config follow slack notification config

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-04-18 08:21:32 +03:00
parent 29e16abc85
commit 9f9dbdbdee
3 changed files with 10 additions and 6 deletions
@@ -20,7 +20,9 @@ notifications:
sender: 'sender@mycompany.com'
replyTo: 'no-reply@mycompany.com'
broadcastConfig:
receiver: 'user'
receiver: 'users'
cache:
ttl: 60000
```
See `config.d.ts` for more options for configuration.
+6 -4
View File
@@ -105,10 +105,12 @@ export interface Config {
*/
receiverEmails?: string[];
};
/**
* Email cache TTL, defaults to 1 hour
*/
cacheTtl?: number;
cache?: {
/**
* Email cache TTL, defaults to 1 hour
*/
ttl?: number;
};
};
};
};
@@ -58,7 +58,7 @@ export class NotificationsEmailProcessor implements NotificationProcessor {
config.getOptionalString('notifications.email.format') ?? 'html';
this.replyTo = config.getOptionalString('notifications.email.replyTo');
this.cacheTtl =
config.getOptionalNumber('notifications.email.cacheTtl') ?? 3_600_000;
config.getOptionalNumber('notifications.email.cache.ttl') ?? 3_600_000;
}
private async getTransporter() {