all: apply go fix
Updates #cleanup Signed-off-by: Adriano Sela Aviles <adriano@tailscale.com>
This commit is contained in:
committed by
Adriano Sela Aviles
parent
a5102d3fcb
commit
d69bf2685a
@@ -315,9 +315,7 @@ func (s *userServer) runLoop() {
|
||||
consecutiveFailures = 1
|
||||
}
|
||||
sleepTime := time.Duration(math.Pow(2, consecutiveFailures)) * time.Millisecond
|
||||
if sleepTime > maxSleepTime {
|
||||
sleepTime = maxSleepTime
|
||||
}
|
||||
sleepTime = min(sleepTime, maxSleepTime)
|
||||
s.logf("user server % v stopped with error %v, will try again in %v", s.executable, err, sleepTime)
|
||||
time.Sleep(sleepTime)
|
||||
}
|
||||
|
||||
@@ -42,10 +42,7 @@ func (d *DirFile) Readdir(count int) ([]fs.FileInfo, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
n := len(d.children)
|
||||
if count < n {
|
||||
n = count
|
||||
}
|
||||
n := min(count, len(d.children))
|
||||
result := d.children[:n]
|
||||
d.children = d.children[n:]
|
||||
if len(d.children) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user