Skip to content

Commit 49f1a26

Browse files
authored
SetTimeout
heroku#31 较好的方法应该是这个支持context
1 parent c21a167 commit 49f1a26

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

registry/registry.go

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"log"
77
"net/http"
88
"strings"
9+
"time"
910
)
1011

1112
type LogfCallback func(format string, args ...interface{})
@@ -118,3 +119,8 @@ func (r *Registry) Ping() error {
118119
}
119120
return err
120121
}
122+
123+
func (r *Registry) SetTimeout(duration time.Duration) {
124+
r.Client.Timeout = duration
125+
}
126+

0 commit comments

Comments
 (0)