From 7ae98c9aca0a12d213de87c0fb9c3d6325ca9336 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Tue, 30 Dec 2025 12:35:02 +0900 Subject: [PATCH] spindle: parse `time.Duration` when parsing spindle config Signed-off-by: Seongmin Lee --- spindle/config/config.go | 5 +++-- spindle/engines/nixery/engine.go | 9 +-------- 2 files changed, 4 insertions(+), 10 deletions(-) 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 { -- 2.51.2