mirror of https://github.com/daffainfo/nuclei.git
Fixed build error on 32bit arch
parent
c694fd82e5
commit
09ceb29ba3
|
@ -242,9 +242,9 @@ func New(options *types.Options) (*Runner, error) {
|
|||
}
|
||||
|
||||
if options.RateLimitMinute > 0 {
|
||||
runner.ratelimiter = ratelimit.New(context.Background(), options.RateLimitMinute, time.Minute)
|
||||
runner.ratelimiter = ratelimit.New(context.Background(), int64(options.RateLimitMinute), time.Minute)
|
||||
} else if options.RateLimit > 0 {
|
||||
runner.ratelimiter = ratelimit.New(context.Background(), options.RateLimit, time.Second)
|
||||
runner.ratelimiter = ratelimit.New(context.Background(), int64(options.RateLimit), time.Second)
|
||||
} else {
|
||||
runner.ratelimiter = ratelimit.NewUnlimited(context.Background())
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ func NewMockExecuterOptions(options *types.Options, info *TemplateInfo) *protoco
|
|||
IssuesClient: nil,
|
||||
Browser: nil,
|
||||
Catalog: disk.NewCatalog(options.TemplatesDirectory),
|
||||
RateLimiter: ratelimit.New(context.Background(), options.RateLimit, time.Second),
|
||||
RateLimiter: ratelimit.New(context.Background(), int64(options.RateLimit), time.Second),
|
||||
}
|
||||
return executerOpts
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
|
||||
// Limiter allows a burst of request during the defined duration
|
||||
type Limiter struct {
|
||||
maxCount int
|
||||
count int
|
||||
maxCount int64
|
||||
count int64
|
||||
ticker *time.Ticker
|
||||
tokens chan struct{}
|
||||
ctx context.Context
|
||||
|
@ -40,7 +40,7 @@ func (rateLimiter *Limiter) Take() {
|
|||
}
|
||||
|
||||
// New creates a new limiter instance with the tokens amount and the interval
|
||||
func New(ctx context.Context, max int, duration time.Duration) *Limiter {
|
||||
func New(ctx context.Context, max int64, duration time.Duration) *Limiter {
|
||||
limiter := &Limiter{
|
||||
maxCount: max,
|
||||
count: max,
|
||||
|
|
Loading…
Reference in New Issue