Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

settings: add network.connection_timeout and network.cloud_api.skip_board_detection_calls #2770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Set default duration to 60 seconds
  • Loading branch information
cmaglie committed Dec 10, 2024
commit a1da0d8066d42e31e2323deda833b5dfcadeebc0
3 changes: 2 additions & 1 deletion 3 docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
[time.ParseDuration()](https://pkg.go.dev/time#ParseDuration), defaults to `720h` (30 days).
- `network` - configuration options related to the network connection.
- `proxy` - URL of the proxy server.
- `connection_timeout` - connection timeout in seconds, defaults to `0` which will wait indefinitely.
- `connection_timeout` - network connection timeout, the value format must be a valid input for
[time.ParseDuration()](https://pkg.go.dev/time#ParseDuration), defaults to `60s` (60 seconds). `0` means it will wait indefinitely.

### Default directories

Expand Down
2 changes: 1 addition & 1 deletion 2 internal/cli/configuration/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func SetDefaults(settings *Settings) {
// network settings
setKeyTypeSchema("network.proxy", "")
setKeyTypeSchema("network.user_agent_ext", "")
setKeyTypeSchema("network.connection_timeout", 0)
setDefaultValueAndKeyTypeSchema("network.connection_timeout", (time.Second * 60).String())

// locale
setKeyTypeSchema("locale", "")
Expand Down
7 changes: 5 additions & 2 deletions 7 internal/cli/configuration/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ func (settings *Settings) ExtraUserAgent() string {
return settings.GetString("network.user_agent_ext")
}

// ConnectionTimeout returns the network connection timeout
func (settings *Settings) ConnectionTimeout() time.Duration {
timeout := settings.GetInt("network.connection_timeout")
return time.Duration(timeout) * time.Second
if timeout, ok, _ := settings.GetDurationOk("network.connection_timeout"); ok {
return timeout
}
return settings.Defaults.GetDuration("network.connection_timeout")
}

// NetworkProxy returns the proxy configuration (mainly used by HTTP clients)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.