mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 20:55:28 +00:00
* feat: fixed leak * add go leak unit test in sdk * added goleak unit tests * bugfix: add random user agents to fuzzing requests * misc * misc * fix lint + use utils pr + misc * fix ratelimit memleak in sdk * close protocolstate shared resources in nuclei sdk/lib * add missing close references * ignore read/write loop of intransit connections * close unnecessary idle conns * add ignore method * using fixed utils * dep update --------- Co-authored-by: Ice3man <nizamulrana@gmail.com> Co-authored-by: mzack <marco.rivoli.nvh@gmail.com> Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
24 lines
561 B
Go
24 lines
561 B
Go
package compiler
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/dop251/goja"
|
|
syncutil "github.com/projectdiscovery/utils/sync"
|
|
)
|
|
|
|
var (
|
|
ephemeraljsc *syncutil.AdaptiveWaitGroup
|
|
lazyFixedSgInit = sync.OnceFunc(func() {
|
|
ephemeraljsc, _ = syncutil.New(syncutil.WithSize(NonPoolingVMConcurrency))
|
|
})
|
|
)
|
|
|
|
func executeWithoutPooling(p *goja.Program, args *ExecuteArgs, opts *ExecuteOptions) (result goja.Value, err error) {
|
|
lazyFixedSgInit()
|
|
ephemeraljsc.Add()
|
|
defer ephemeraljsc.Done()
|
|
runtime := createNewRuntime()
|
|
return executeWithRuntime(runtime, p, args, opts)
|
|
}
|