Cleanup syncapi topology logic (#1035)

* Cleanup syncapi topology logic

* Variable renaming

* comments
This commit is contained in:
Kegsay 2020-05-14 17:30:16 +01:00 committed by GitHub
parent 3cb04e8004
commit 7ca230e931
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 67 additions and 154 deletions

View file

@ -119,8 +119,11 @@ func (t *TopologyToken) Decrement() {
depth := t.Positions[0]
pduPos := t.Positions[1]
if depth-1 <= 0 {
// nothing can be lower than this
depth = 1
} else {
// this assumes that we will never have 1000 events all with the same
// depth. TODO: work out what the right PDU position is to use, probably needs a db hit.
depth--
pduPos += 1000
}