projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '13931-cwltool-deps' refs #13931
[arvados.git]
/
services
/
keep-balance
/
main.go
diff --git
a/services/keep-balance/main.go
b/services/keep-balance/main.go
index 947033564df01e479d05682617fc041417e5d54f..90235cbf3188d91bc274412ddd5522dc639fa812 100644
(file)
--- a/
services/keep-balance/main.go
+++ b/
services/keep-balance/main.go
@@
-9,6
+9,7
@@
import (
"flag"
"fmt"
"log"
"flag"
"fmt"
"log"
+ "net/http"
"os"
"os/signal"
"syscall"
"os"
"os/signal"
"syscall"
@@
-45,6
+46,9
@@
type Config struct {
// more memory, but can reduce store-and-forward latency when
// fetching pages)
CollectionBuffers int
// more memory, but can reduce store-and-forward latency when
// fetching pages)
CollectionBuffers int
+
+ // Timeout for outgoing http request/response cycle.
+ RequestTimeout arvados.Duration
}
// RunOptions controls runtime behavior. The flags/options that belong
}
// RunOptions controls runtime behavior. The flags/options that belong
@@
-107,6
+111,14
@@
func main() {
log.Fatal(config.DumpAndExit(cfg))
}
log.Fatal(config.DumpAndExit(cfg))
}
+ to := time.Duration(cfg.RequestTimeout)
+ if to == 0 {
+ to = 30 * time.Minute
+ }
+ arvados.DefaultSecureClient.Timeout = to
+ arvados.InsecureHTTPClient.Timeout = to
+ http.DefaultClient.Timeout = to
+
log.Printf("keep-balance %s started", version)
if *debugFlag {
log.Printf("keep-balance %s started", version)
if *debugFlag {