Skip to content

Removing singletons #6210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: dev
Choose a base branch
from
Draft
Prev Previous commit
fd fix
  • Loading branch information
Mzack9999 committed May 9, 2025
commit 2a6c6dab552fa414d80f36468e65cd3f4fda9cc0
9 changes: 6 additions & 3 deletions pkg/catalog/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"os"
"sort"
"strings"
"sync"

"github.com/logrusorgru/aurora"
"github.com/pkg/errors"
Expand All @@ -28,6 +27,7 @@ import (
errorutil "github.com/projectdiscovery/utils/errors"
sliceutil "github.com/projectdiscovery/utils/slice"
stringsutil "github.com/projectdiscovery/utils/strings"
syncutil "github.com/projectdiscovery/utils/sync"
urlutil "github.com/projectdiscovery/utils/url"
"github.com/rs/xid"
)
Expand Down Expand Up @@ -504,7 +504,10 @@ func (store *Store) LoadTemplatesWithTags(templatesList, tags []string) []*templ
}
}

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

if store.config.ExecutorOptions.Options.ExecutionId == "" {
store.config.ExecutorOptions.Options.ExecutionId = xid.New().String()
Expand All @@ -516,7 +519,7 @@ func (store *Store) LoadTemplatesWithTags(templatesList, tags []string) []*templ
}

for templatePath := range templatePathMap {
wgLoadTemplates.Add(1)
wgLoadTemplates.Add()
go func(templatePath string) {
defer wgLoadTemplates.Done()

Expand Down
Loading