Init queue after final identifier name has been set

This commit is contained in:
Achim Rohn
2026-04-05 11:59:14 +02:00
parent 67791ec3c3
commit c4d9f57d3f
+8 -4
View File
@@ -37,12 +37,15 @@ func NewStep(params *StepParams) *Step {
StepParams: *params, StepParams: *params,
NextSteps: make(map[string]*Step), NextSteps: make(map[string]*Step),
} }
step.Queue = queue.NewGeneralQueue(params.Identifier,
params.Client, step.HandleQueue, params.Processors,
queue.WithAutoStop(true))
return &step return &step
} }
func (s *Step) initQueue() {
s.Queue = queue.NewGeneralQueue(s.Identifier,
s.Client, s.HandleQueue, s.Processors,
queue.WithAutoStop(true))
}
func (s *Step) AddNextStep(step *Step) { func (s *Step) AddNextStep(step *Step) {
s.NextSteps[step.Name] = step s.NextSteps[step.Name] = step
} }
@@ -90,7 +93,8 @@ type Workflow struct {
func NewWorkflow(name string, identifier string, firstStep *Step, allSteps []*Step) *Workflow { func NewWorkflow(name string, identifier string, firstStep *Step, allSteps []*Step) *Workflow {
for _, step := range allSteps { for _, step := range allSteps {
step.Identifier = identifier + "_" + step.Name step.Identifier = identifier + "_" + step.Identifier
step.initQueue()
} }
return &Workflow{ return &Workflow{
Name: name, Name: name,