File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
backend/internal/features/notifiers/models/slack Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -70,13 +70,18 @@ func (s *SlackNotifier) Send(
7070 maxAttempts = 5
7171 defaultBackoff = 2 * time .Second // when Retry-After header missing
7272 backoffMultiplier = 1.5 // use exponential growth
73+ requestTimeout = 30 * time .Second
7374 )
7475
7576 var (
7677 backoff = defaultBackoff
7778 attempts = 0
7879 )
7980
81+ client := & http.Client {
82+ Timeout : requestTimeout ,
83+ }
84+
8085 for {
8186 attempts ++
8287
@@ -92,7 +97,7 @@ func (s *SlackNotifier) Send(
9297 req .Header .Set ("Content-Type" , "application/json; charset=utf-8" )
9398 req .Header .Set ("Authorization" , "Bearer " + botToken )
9499
95- resp , err := http . DefaultClient .Do (req )
100+ resp , err := client .Do (req )
96101 if err != nil {
97102 return fmt .Errorf ("send slack message: %w" , err )
98103 }
You can’t perform that action at this time.
0 commit comments