From f52f3424a06a601f875e71f92e0999dedf26a361 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 25 Oct 2016 21:52:22 +0100 Subject: [PATCH] sync: fix recent errors logging It used to shift right and then slice the end. Change-Id: I469e7ca191889e5e92811bb2094f24044a4e963d --- pkg/server/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/server/sync.go b/pkg/server/sync.go index 504b6614d..2e56b64da 100644 --- a/pkg/server/sync.go +++ b/pkg/server/sync.go @@ -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)