Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions pkg/catalog/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,18 +706,27 @@ func (store *Store) LoadTemplatesWithTags(templatesList, tags []string) []*templ
concurrency = types.DefaultTemplateLoadingConcurrency
}

wgLoadTemplates, errWg := syncutil.New(syncutil.WithSize(concurrency))
if errWg != nil {
panic("could not create wait group")
}

if typesOpts.ExecutionId == "" {
typesOpts.ExecutionId = xid.New().String()
}

dialers := protocolstate.GetDialersWithId(typesOpts.ExecutionId)
if dialers == nil {
panic("dialers with executionId " + typesOpts.ExecutionId + " not found")
if err := protocolstate.Init(typesOpts); err != nil {
store.logger.Error().Msgf("dialers init failed for executionId %s: %s", typesOpts.ExecutionId, err)
return []*templates.Template{}
}
dialers = protocolstate.GetDialersWithId(typesOpts.ExecutionId)
if dialers == nil {
store.logger.Error().Msgf("dialers with executionId %s not found", typesOpts.ExecutionId)
return []*templates.Template{}
}
}

wgLoadTemplates, errWg := syncutil.New(syncutil.WithSize(concurrency))
if errWg != nil {
store.logger.Error().Msgf("could not create wait group: %s", errWg)
return []*templates.Template{}
}

for _, templatePath := range includedTemplates {
Expand Down