fix relay round sync log rotation
parent
f0235c8d3b
commit
fa4ecb5a76
|
@ -14,7 +14,10 @@ case class SyncLog(events: Vector[SyncLog.Event]) extends AnyVal {
|
||||||
|
|
||||||
def add(event: SyncLog.Event) =
|
def add(event: SyncLog.Event) =
|
||||||
copy(
|
copy(
|
||||||
events = events.take(SyncLog.historySize - 1) :+ event
|
events = {
|
||||||
|
if (events.sizeIs > SyncLog.historySize) events drop 1
|
||||||
|
else events
|
||||||
|
} :+ event
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue