Skip to content

Commit

Permalink
fix: return list of webhooks for anchor notifs
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 committed May 20, 2024
1 parent a611c49 commit bb7d5da
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions cd/manager/notifs/anchor.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,22 @@ import (
var _ jobNotif = &anchorNotif{}

type anchorNotif struct {
state job.JobState
alertWebhook webhook.Client
warningWebhook webhook.Client
infoWebhook webhook.Client
region string
env string
state job.JobState
alertWebhook webhook.Client
infoWebhook webhook.Client
region string
env string
}

func newAnchorNotif(jobState job.JobState) (jobNotif, error) {
if a, err := parseDiscordWebhookUrl("DISCORD_ALERT_WEBHOOK"); err != nil {
return nil, err
} else if w, err := parseDiscordWebhookUrl("DISCORD_WARNING_WEBHOOK"); err != nil {
return nil, err
} else if i, err := parseDiscordWebhookUrl("DISCORD_INFO_WEBHOOK"); err != nil {
return nil, err
} else {
return &anchorNotif{
jobState,
a,
w,
i,
os.Getenv("AWS_REGION"),
os.Getenv(manager.EnvVar_Env),
Expand All @@ -52,7 +48,7 @@ func (a anchorNotif) getChannels() []webhook.Client {
case job.JobStage_Failed:
webhooks = append(webhooks, a.alertWebhook)
}
return nil
return webhooks
}

func (a anchorNotif) getTitle() string {
Expand Down

0 comments on commit bb7d5da

Please sign in to comment.