Skip to content

Commit 2a009af

Browse files
committed
fix: ci
1 parent 9400cca commit 2a009af

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

config/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ const (
6161
// 原实现通过 viper/remote + sagikazarmark/crypt 读取,但该依赖链会引入
6262
// golang.org/x/crypto/openpgp(GO-2026-5932,该包无人维护、无修复版本),
6363
// 因此改为直接使用 etcd client/v3 读取,行为保持一致。
64-
remotePath = "/config"
65-
remoteFileType = "yaml"
64+
remotePath = "/config"
65+
remoteFileType = "yaml"
66+
etcdReadTimeout = 3 * time.Second
6667
)
6768

6869
func Init(service string) {
@@ -97,7 +98,7 @@ func InitFromETCD(service string) {
9798
}
9899
}()
99100

100-
ctx, cancel := context.WithTimeout(context.Background(), time.Second*3)
101+
ctx, cancel := context.WithTimeout(context.Background(), etcdReadTimeout)
101102
defer cancel()
102103
resp, err := cli.Get(ctx, remotePath)
103104
if err != nil {

0 commit comments

Comments
 (0)