Skip to content

Commit

Permalink
SetTimeout
Browse files Browse the repository at this point in the history
heroku#31
较好的方法应该是这个支持context
  • Loading branch information
wadefelix authored May 26, 2020
1 parent c21a167 commit 49f1a26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"net/http"
"strings"
"time"
)

type LogfCallback func(format string, args ...interface{})
Expand Down Expand Up @@ -118,3 +119,8 @@ func (r *Registry) Ping() error {
}
return err
}

func (r *Registry) SetTimeout(duration time.Duration) {
r.Client.Timeout = duration
}

0 comments on commit 49f1a26

Please sign in to comment.