Fixed build error on 32bit arch

dev
Ice3man 2022-10-08 01:55:18 +05:30
parent c694fd82e5
commit 09ceb29ba3
3 changed files with 6 additions and 6 deletions

View File

@ -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())
}

View File

@ -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
}

View File

@ -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,