Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/js/compiler/init.go
2070 views
1
package compiler
2
3
import (
4
"sync"
5
6
"github.com/projectdiscovery/nuclei/v3/pkg/types"
7
)
8
9
// jsprotocolInit
10
11
var (
12
PoolingJsVmConcurrency = 100
13
NonPoolingVMConcurrency = 20
14
m sync.Mutex
15
)
16
17
// Init initializes the javascript protocol
18
func Init(opts *types.Options) error {
19
m.Lock()
20
defer m.Unlock()
21
22
if opts.JsConcurrency < 100 {
23
// 100 is reasonable default
24
opts.JsConcurrency = 100
25
}
26
PoolingJsVmConcurrency = opts.JsConcurrency
27
PoolingJsVmConcurrency -= NonPoolingVMConcurrency
28
return nil
29
}
30
31