Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: timeout (#3422)

p0ny097a4b57f6c4
diff --git a/plugin/app/feishu/feishu.go b/plugin/app/feishu/feishu.go
index 07f27feb7e..c6db102d04 100644
--- a/plugin/app/feishu/feishu.go
+++ b/plugin/app/feishu/feishu.go
@@ -10,6 +10,7 @@ import (
"net/http"
"strings"
"sync/atomic"
+ "time"
"github.com/pkg/errors"
)
@@ -21,6 +22,8 @@ const (
invalidTokenRespCode = 99991663
)
+const timeout = 30 * time.Second
+
// Provider is the provider for IM Feishu.
type Provider struct {
// cache token in memory.
@@ -35,7 +38,9 @@ type tokenRefresher func(ctx context.Context, client *http.Client, oldToken *str
// NewProvider returns a Provider.
func NewProvider() *Provider {
p := Provider{
- client: &http.Client{},
+ client: &http.Client{
+ Timeout: timeout,
+ },
}
// initialize token
p.Token.Store("")