mirror of https://github.com/perkeep/perkeep.git
sync: fix recent errors logging
It used to shift right and then slice the end. Change-Id: I469e7ca191889e5e92811bb2094f24044a4e963d
This commit is contained in:
parent
41d0f41d88
commit
f52f3424a0
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue