mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2024-11-24 21:58:46 +03:00
feat: shutdown_timeout == timeout by default
This commit is contained in:
parent
30029567f7
commit
31b3de2c96
2 changed files with 5 additions and 1 deletions
|
@ -25,7 +25,8 @@ runner:
|
||||||
timeout: 3h
|
timeout: 3h
|
||||||
# The timeout for the runner to wait for running jobs to finish when shutting down.
|
# The timeout for the runner to wait for running jobs to finish when shutting down.
|
||||||
# Any running jobs that haven't finished after this timeout will be cancelled.
|
# Any running jobs that haven't finished after this timeout will be cancelled.
|
||||||
shutdown_timeout: 0s
|
# Defaults to the same value as timeout if unset or 0.
|
||||||
|
shutdown_timeout: 3h
|
||||||
# Whether skip verifying the TLS certificate of the instance.
|
# Whether skip verifying the TLS certificate of the instance.
|
||||||
insecure: false
|
insecure: false
|
||||||
# The timeout for fetching the job from the Forgejo instance.
|
# The timeout for fetching the job from the Forgejo instance.
|
||||||
|
|
|
@ -121,6 +121,9 @@ func LoadDefault(file string) (*Config, error) {
|
||||||
if cfg.Runner.Timeout <= 0 {
|
if cfg.Runner.Timeout <= 0 {
|
||||||
cfg.Runner.Timeout = 3 * time.Hour
|
cfg.Runner.Timeout = 3 * time.Hour
|
||||||
}
|
}
|
||||||
|
if cfg.Runner.ShutdownTimeout <= 0 {
|
||||||
|
cfg.Runner.ShutdownTimeout = cfg.Runner.Timeout
|
||||||
|
}
|
||||||
if cfg.Cache.Enabled == nil {
|
if cfg.Cache.Enabled == nil {
|
||||||
b := true
|
b := true
|
||||||
cfg.Cache.Enabled = &b
|
cfg.Cache.Enabled = &b
|
||||||
|
|
Loading…
Reference in a new issue