@@ -60,6 +60,7 @@ import (
|
||||
"go.probo.inc/probo/pkg/server"
|
||||
"go.probo.inc/probo/pkg/slack"
|
||||
"go.probo.inc/probo/pkg/trust"
|
||||
"go.probo.inc/probo/pkg/webhook"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
@@ -154,6 +155,9 @@ func New() *Implm {
|
||||
Slack: slackConfig{
|
||||
SenderInterval: 60,
|
||||
},
|
||||
Webhook: webhookConfig{
|
||||
SenderInterval: 5,
|
||||
},
|
||||
},
|
||||
CustomDomains: customDomainsConfig{
|
||||
RenewalInterval: 3600,
|
||||
@@ -479,6 +483,19 @@ 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,
|
||||
EncryptionKey: impl.cfg.EncryptionKey,
|
||||
})
|
||||
wg.Go(
|
||||
func() {
|
||||
if err := webhookSender.Run(webhookSenderCtx); err != nil {
|
||||
cancel(fmt.Errorf("webhook sender crashed: %w", err))
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
exportJobExporterCtx, stopExportJobExporter := context.WithCancel(context.Background())
|
||||
wg.Go(
|
||||
func() {
|
||||
@@ -511,6 +528,7 @@ func (impl *Implm) Run(
|
||||
|
||||
stopMailer()
|
||||
stopSlackSender()
|
||||
stopWebhookSender()
|
||||
stopExportJobExporter()
|
||||
stopIAMService()
|
||||
stopApiServer()
|
||||
|
||||
Reference in New Issue
Block a user