Skip to content

Commit 625768a

Browse files
Merge pull request #19983 from enj/enj/i/fix_migrate_math
Fix math division truncation in migrate storage
2 parents 1ff2229 + 5453395 commit 625768a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/oc/admin/migrate/storage/storage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,5 +373,5 @@ func (t *tokenLimiter) getDuration(n int) time.Duration {
373373
// we use a burst value that scales linearly with the number of workers
374374
func newTokenLimiter(bandwidth, workers int) *tokenLimiter {
375375
burst := 100 * kbToBytes * workers // 100 KB of burst per worker
376-
return &tokenLimiter{burst: burst, rateLimiter: rate.NewLimiter(rate.Limit(bandwidth*mbToKB*kbToBytes/byteToBits), burst), nowFunc: time.Now}
376+
return &tokenLimiter{burst: burst, rateLimiter: rate.NewLimiter(rate.Limit(bandwidth*mbToKB*kbToBytes)/byteToBits, burst), nowFunc: time.Now}
377377
}

0 commit comments

Comments
 (0)