MCPcopy
hub / github.com/rclone/rclone / Calculate

Method Calculate

fs/pacer.go:39–52  ·  view source on GitHub ↗
(state pacer.State)

Source from the content-addressed store, hash-verified

37}
38
39func (d *logCalculator) Calculate(state pacer.State) time.Duration {
40 oldSleepTime := state.SleepTime
41 newSleepTime := d.Calculator.Calculate(state)
42 if state.ConsecutiveRetries > 0 {
43 if newSleepTime != oldSleepTime {
44 Debugf("pacer", "Rate limited, increasing sleep to %v", newSleepTime)
45 }
46 } else {
47 if newSleepTime != oldSleepTime {
48 Debugf("pacer", "Reducing sleep to %v", newSleepTime)
49 }
50 }
51 return newSleepTime
52}
53
54// SetCalculator sets the pacing algorithm. Don't modify the Calculator object
55// afterwards, use the ModifyCalculator method when needed.

Callers

nothing calls this directly

Calls 2

DebugfFunction · 0.85
CalculateMethod · 0.65

Tested by

no test coverage detected