limit the number of hosts read from each pong

pull/53/head
Zlatin Balevsky 2020-09-17 16:19:48 +01:00
parent 20aac03789
commit b18772465c
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ abstract class Connection implements Closeable {
lastPongReceivedTime = System.currentTimeMillis() lastPongReceivedTime = System.currentTimeMillis()
if (pong.pongs == null) if (pong.pongs == null)
throw new Exception("Pong doesn't have pongs") throw new Exception("Pong doesn't have pongs")
pong.pongs.each { pong.pongs.stream().limit(10).forEach {
def dest = new Destination(it) def dest = new Destination(it)
eventBus.publish(new HostDiscoveredEvent(destination: dest)) eventBus.publish(new HostDiscoveredEvent(destination: dest))
} }