diff --git a/spindle/config/config.go b/spindle/config/config.go index 854159ad..3d50e2c1 100644 --- a/spindle/config/config.go +++ b/spindle/config/config.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "path/filepath" + "time" "github.com/bluesky-social/indigo/atproto/syntax" "github.com/sethvargo/go-envconfig" @@ -46,8 +47,8 @@ type OpenBaoConfig struct { } type NixeryPipelines struct { - Nixery string `env:"NIXERY, default=nixery.tangled.sh"` - WorkflowTimeout string `env:"WORKFLOW_TIMEOUT, default=5m"` + Nixery string `env:"NIXERY, default=nixery.tangled.sh"` + WorkflowTimeout time.Duration `env:"WORKFLOW_TIMEOUT, default=5m"` } type Config struct { diff --git a/spindle/engines/nixery/engine.go b/spindle/engines/nixery/engine.go index 24135263..e754fd67 100644 --- a/spindle/engines/nixery/engine.go +++ b/spindle/engines/nixery/engine.go @@ -122,14 +122,7 @@ func (e *Engine) InitWorkflow(twf tangled.Pipeline_Workflow, tpl tangled.Pipelin } func (e *Engine) WorkflowTimeout() time.Duration { - workflowTimeoutStr := e.cfg.NixeryPipelines.WorkflowTimeout - workflowTimeout, err := time.ParseDuration(workflowTimeoutStr) - if err != nil { - e.l.Error("failed to parse workflow timeout", "error", err, "timeout", workflowTimeoutStr) - workflowTimeout = 5 * time.Minute - } - - return workflowTimeout + return e.cfg.NixeryPipelines.WorkflowTimeout } func workflowImage(deps map[string][]string, nixery string) string {