nuclei/pkg/js/compiler/init.go
Dogan Can Bakir f080d614c3
introduce timeouts config in types.Options (#5228)
* introduce timeout variants

* update instances and add codeexectimeout

* fix test

* default to 10s

* minor

* make timeouts pluggable and rename

* remove residual code

---------

Co-authored-by: Tarun Koyalwar <tarun@projectdiscovery.io>
2024-07-15 15:57:15 +05:30

25 lines
456 B
Go

package compiler
import (
"github.com/projectdiscovery/nuclei/v3/pkg/types"
)
// jsprotocolInit
var (
PoolingJsVmConcurrency = 100
NonPoolingVMConcurrency = 20
)
// Init initializes the javascript protocol
func Init(opts *types.Options) error {
if opts.JsConcurrency < 100 {
// 100 is reasonable default
opts.JsConcurrency = 100
}
PoolingJsVmConcurrency = opts.JsConcurrency
PoolingJsVmConcurrency -= NonPoolingVMConcurrency
return nil
}