[FORGEJO] lifetime 0 converts to infinity #3

Merged
earl-warren merged 1 commit from earl-warren/act:wip-lifetime into main 2023-03-19 09:28:24 +00:00

View file

@ -390,9 +390,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,