File tree 3 files changed +8
-4
lines changed
internal/cli/configuration
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 45
45
[ time.ParseDuration()] ( https://pkg.go.dev/time#ParseDuration ) , defaults to ` 720h ` (30 days).
46
46
- ` network ` - configuration options related to the network connection.
47
47
- ` proxy ` - URL of the proxy server.
48
- - ` connection_timeout ` - connection timeout in seconds, defaults to ` 0 ` which will wait indefinitely.
48
+ - ` connection_timeout ` - network connection timeout, the value format must be a valid input for
49
+ [ time.ParseDuration()] ( https://pkg.go.dev/time#ParseDuration ) , defaults to ` 60s ` (60 seconds). ` 0 ` means it will wait indefinitely.
49
50
50
51
### Default directories
51
52
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ func SetDefaults(settings *Settings) {
71
71
// network settings
72
72
setKeyTypeSchema ("network.proxy" , "" )
73
73
setKeyTypeSchema ("network.user_agent_ext" , "" )
74
- setKeyTypeSchema ("network.connection_timeout" , 0 )
74
+ setDefaultValueAndKeyTypeSchema ("network.connection_timeout" , ( time . Second * 60 ). String () )
75
75
76
76
// locale
77
77
setKeyTypeSchema ("locale" , "" )
Original file line number Diff line number Diff line change @@ -59,9 +59,12 @@ func (settings *Settings) ExtraUserAgent() string {
59
59
return settings .GetString ("network.user_agent_ext" )
60
60
}
61
61
62
+ // ConnectionTimeout returns the netowrk connection timeout
62
63
func (settings * Settings ) ConnectionTimeout () time.Duration {
63
- timeout := settings .GetInt ("network.connection_timeout" )
64
- return time .Duration (timeout ) * time .Second
64
+ if timeout , ok , _ := settings .GetDurationOk ("network.connection_timeout" ); ok {
65
+ return timeout
66
+ }
67
+ return settings .Defaults .GetDuration ("network.connection_timeout" )
65
68
}
66
69
67
70
// NetworkProxy returns the proxy configuration (mainly used by HTTP clients)
You can’t perform that action at this time.
0 commit comments