[FORGEJO] lifetime 0 converts to infinity
Closes: https://code.forgejo.org/forgejo/act/issues/2
(cherry picked from commit 6dc2a8e888
)
This commit is contained in:
parent
1a3160510b
commit
0c2c019584
1 changed files with 5 additions and 1 deletions
|
@ -472,9 +472,13 @@ func (rc *RunContext) startJobContainer() common.Executor {
|
|||
return nil
|
||||
}
|
||||
|
||||
lifetime := fmt.Sprint(rc.Config.ContainerMaxLifetime.Round(time.Second).Seconds())
|
||||
if lifetime == "0" {
|
||||
lifetime = "infinity"
|
||||
}
|
||||
rc.JobContainer = container.NewContainer(&container.NewContainerInput{
|
||||
Cmd: nil,
|
||||
Entrypoint: []string{"/bin/sleep", fmt.Sprint(rc.Config.ContainerMaxLifetime.Round(time.Second).Seconds())},
|
||||
Entrypoint: []string{"/bin/sleep", lifetime},
|
||||
WorkingDir: ext.ToContainerPath(rc.Config.Workdir),
|
||||
Image: image,
|
||||
Username: username,
|
||||
|
|
Loading…
Reference in a new issue