mirror of
https://github.com/foomo/posh-providers.git
synced 2025-10-16 12:35:41 +00:00
feat(slack): add timeout
This commit is contained in:
parent
9184e09916
commit
1cf6500352
@ -3,6 +3,7 @@ package slack
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/foomo/posh-providers/onepassword"
|
||||
"github.com/foomo/posh/pkg/log"
|
||||
@ -130,6 +131,8 @@ func (s *Slack) SendETCDUpdateMessage(ctx context.Context, cluster string) error
|
||||
}
|
||||
|
||||
func (s *Slack) Send(ctx context.Context, channel string, opts ...slack.MsgOption) error {
|
||||
ctx, cancel := context.WithTimeout(ctx, time.Second*10)
|
||||
defer cancel()
|
||||
client, err := s.Client(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Loading…
Reference in New Issue
Block a user