Add cache ttl

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-02-13 13:59:36 +01:00
parent 007f58d76f
commit c163ca9bf0
3 changed files with 30 additions and 13 deletions

View File

@@ -22,4 +22,5 @@ type notificationsConfig struct {
type webhookConfig struct {
SenderInterval int `json:"sender-interval"`
CacheTTL int `json:"cache-ttl"`
}

View File

@@ -157,6 +157,7 @@ func New() *Implm {
},
Webhook: webhookConfig{
SenderInterval: 5,
CacheTTL: 86400,
},
},
CustomDomains: customDomainsConfig{
@@ -486,6 +487,7 @@ func (impl *Implm) Run(
webhookSenderCtx, stopWebhookSender := context.WithCancel(context.Background())
webhookSender := webhook.NewSender(pgClient, l.Named("webhook-sender"), webhook.Config{
Interval: time.Duration(impl.cfg.Notifications.Webhook.SenderInterval) * time.Second,
CacheTTL: time.Duration(impl.cfg.Notifications.Webhook.CacheTTL) * time.Second,
EncryptionKey: impl.cfg.EncryptionKey,
})
wg.Go(