Open platform to collect and prioritize feedback
Option to keep failing webhooks enabled.
Matt Roberts978ce4fea7a7
diff --git a/app/pkg/env/env.go b/app/pkg/env/env.goindex a98b6578c..2c7bc5e4f 100644--- a/app/pkg/env/env.go+++ b/app/pkg/env/env.go@@ -144,6 +144,9 @@ type config struct {Message string `env:"MAINTENANCE_MESSAGE"`Until string `env:"MAINTENANCE_UNTIL"`}+ Webhook struct {+ DisableOnFailure bool `env:"WEBHOOK_DISABLE_ON_FAILURE,default=true"`+ }GoogleAnalytics string `env:"GOOGLE_ANALYTICS"`SearchNoiseWords string `env:"SEARCH_NOISE_WORDS,default=add|support|for|implement|create|make|allow|enable|provide|some|also|include|very|make|and|for|to|a|able|function|feature|app"`}diff --git a/app/services/webhook/webhook.go b/app/services/webhook/webhook.goindex b0e4c9fd8..367d148a4 100644--- a/app/services/webhook/webhook.go+++ b/app/services/webhook/webhook.go@@ -3,16 +3,18 @@ package webhookimport ("context""fmt"+ "net/http"+ "strings"+"github.com/getfider/fider/app/models/cmd""github.com/getfider/fider/app/models/dto""github.com/getfider/fider/app/models/entity""github.com/getfider/fider/app/models/query""github.com/getfider/fider/app/pkg/bus"+ "github.com/getfider/fider/app/pkg/env""github.com/getfider/fider/app/pkg/log""github.com/getfider/fider/app/pkg/tpl""github.com/getfider/fider/app/pkg/webhook"- "net/http"- "strings")func init() {@@ -159,10 +161,12 @@ func resultWithError(ctx context.Context, message, error string, result *dto.Web"Error": error,})- webhooks := &query.MarkWebhookAsFailed{ID: result.Webhook.ID}- err := bus.Dispatch(ctx, webhooks)- if err != nil {- return nil, err+ if env.Config.Webhook.DisableOnFailure {+ webhooks := &query.MarkWebhookAsFailed{ID: result.Webhook.ID}+ err := bus.Dispatch(ctx, webhooks)+ if err != nil {+ return nil, err+ }}return result, nil