Skip to content

Commit

Permalink
try more sync again
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Sep 23, 2020
1 parent b559b5f commit 0797ed1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mlat/server/clocktrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,14 @@ def _do_sync(self, address, posA, posB, r0, t0A, t0B, r1, t1A, t1B, now):
k = (r0, r1)
pairing = self.clock_pairs.get(k)
if pairing is None:
if r0.sync_peers + r1.sync_peers > 1.5 * config.MAX_PEERS and r0.sync_peers > 10 and r1.sync_peers > 10:
distance = r0.distance[r1]
if distance < 1e3:
return False
if (
r0.sync_peers + r1.sync_peers > 1.5 * config.MAX_PEERS
and r0.sync_peers > 10 and r1.sync_peers > 10
and distance > config.MAX_PEERS_MIN_DISTANCE
):
return False
r0.sync_peers += 1
r1.sync_peers += 1
Expand Down
3 changes: 3 additions & 0 deletions mlat/server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@

# soft limit for the number of peers a single receiver will have
MAX_PEERS = 50
# limit is only in effect when receivers are further than 50 km apart
MAX_PEERS_MIN_DISTANCE = 50e3


# maximum number of planes we use for sync per receiver (randomly chosen every 15 seconds):
MAX_SYNC_AC = 16
Expand Down

0 comments on commit 0797ed1

Please sign in to comment.