mirror of
https://github.com/rclone/rclone.git
synced 2025-08-16 16:41:34 +02:00
cache: fix bug after golang.org/x/time/rate update
Before this change the cache backend was passing -1 into rate.NewLimiter to mean unlimited transactions per second. In a recent update this immediately returns a rate limit error as might be expected. This patch uses rate.Inf as indicated by the docs to signal no limits are required.
This commit is contained in:
6
backend/cache/cache.go
vendored
6
backend/cache/cache.go
vendored
@ -394,7 +394,11 @@ func NewFs(ctx context.Context, name, rootPath string, m configmap.Mapper) (fs.F
|
||||
notifiedRemotes: make(map[string]bool),
|
||||
}
|
||||
cache.PinUntilFinalized(f.Fs, f)
|
||||
f.rateLimiter = rate.NewLimiter(rate.Limit(float64(opt.Rps)), opt.TotalWorkers)
|
||||
rps := rate.Inf
|
||||
if opt.Rps > 0 {
|
||||
rps = rate.Limit(float64(opt.Rps))
|
||||
}
|
||||
f.rateLimiter = rate.NewLimiter(rps, opt.TotalWorkers)
|
||||
|
||||
f.plexConnector = &plexConnector{}
|
||||
if opt.PlexURL != "" {
|
||||
|
Reference in New Issue
Block a user