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 { 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 { } 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 { } else {
runner.ratelimiter = ratelimit.NewUnlimited(context.Background()) runner.ratelimiter = ratelimit.NewUnlimited(context.Background())
} }

View File

@ -89,7 +89,7 @@ func NewMockExecuterOptions(options *types.Options, info *TemplateInfo) *protoco
IssuesClient: nil, IssuesClient: nil,
Browser: nil, Browser: nil,
Catalog: disk.NewCatalog(options.TemplatesDirectory), 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 return executerOpts
} }

View File

@ -8,8 +8,8 @@ import (
// Limiter allows a burst of request during the defined duration // Limiter allows a burst of request during the defined duration
type Limiter struct { type Limiter struct {
maxCount int maxCount int64
count int count int64
ticker *time.Ticker ticker *time.Ticker
tokens chan struct{} tokens chan struct{}
ctx context.Context ctx context.Context
@ -40,7 +40,7 @@ func (rateLimiter *Limiter) Take() {
} }
// New creates a new limiter instance with the tokens amount and the interval // 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{ limiter := &Limiter{
maxCount: max, maxCount: max,
count: max, count: max,