sync: fix recent errors logging

It used to shift right and then slice the end.

Change-Id: I469e7ca191889e5e92811bb2094f24044a4e963d
This commit is contained in:
Filippo Valsorda 2016-10-25 21:52:22 +01:00
parent 41d0f41d88
commit f52f3424a0
1 changed files with 1 additions and 1 deletions

View File

@ -938,7 +938,7 @@ func (cs *copyStatus) setError(err error) {
// Kinda lame. TODO: use a ring buffer or container/list instead.
if len(sh.recentErrors) == maxRecentErrors {
copy(sh.recentErrors[1:], sh.recentErrors)
copy(sh.recentErrors, sh.recentErrors[1:])
sh.recentErrors = sh.recentErrors[:maxRecentErrors-1]
}
sh.recentErrors = append(sh.recentErrors, br)