whoops
parent
2099ae50c6
commit
3961623373
|
|
@ -2,7 +2,6 @@ package config
|
|||
|
||||
import (
|
||||
"local/rproxy3/storage/packable"
|
||||
"log"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
|
@ -72,7 +71,6 @@ func GetTimeout() int {
|
|||
conf.Get(nsConf, flagTimeout, t)
|
||||
|
||||
timeout, _ := strconv.Atoi(t.String())
|
||||
log.Printf("TIMEOUT t:%q, i:%v", t.String(), timeout)
|
||||
|
||||
return timeout
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ func fromFlags() error {
|
|||
|
||||
for _, bind := range binds {
|
||||
confFlag := flag.Lookup(bind.flag)
|
||||
log.Printf("flag:%v", confFlag)
|
||||
if confFlag == nil || confFlag.Value.String() == "" {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ func (s *Server) doAuth(foo http.HandlerFunc) http.HandlerFunc {
|
|||
func (s *Server) Pre(foo http.HandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx, can := context.WithTimeout(r.Context(), time.Second*time.Duration(config.GetTimeout()))
|
||||
log.Printf("context iwth tiemout: %v", time.Second*time.Duration(config.GetTimeout()))
|
||||
defer can()
|
||||
if err := s.limiter.Wait(ctx); err != nil {
|
||||
w.WriteHeader(http.StatusTooManyRequests)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,18 @@
|
|||
"comment": "",
|
||||
"ignore": "test",
|
||||
"package": [
|
||||
{
|
||||
"checksumSHA1": "GtamqiJoL7PGHsN454AoffBFMa8=",
|
||||
"path": "golang.org/x/net/context",
|
||||
"revision": "65e2d4e15006aab9813ff8769e768bbf4bb667a0",
|
||||
"revisionTime": "2019-02-01T23:59:58Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "HoCvrd3hEhsFeBOdEw7cbcfyk50=",
|
||||
"path": "golang.org/x/time/rate",
|
||||
"revision": "fbb02b2291d28baffd63558aa44b4b56f178d650",
|
||||
"revisionTime": "2018-04-12T16:56:04Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "QqDq2x8XOU7IoOR98Cx1eiV5QY8=",
|
||||
"path": "gopkg.in/yaml.v2",
|
||||
|
|
|
|||
Loading…
Reference in New Issue