Sfoglia il codice sorgente

Make breakout logic after draining N clients more clear

James Allen 10 anni fa
parent
commit
6fa2a81baf
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      services/real-time/app/coffee/DrainManager.coffee

+ 2 - 1
services/real-time/app/coffee/DrainManager.coffee

@@ -19,7 +19,8 @@ module.exports =
 				logger.log {client_id: client.id}, "Asking client to reconnect gracefully"
 				logger.log {client_id: client.id}, "Asking client to reconnect gracefully"
 				client.emit "reconnectGracefully"
 				client.emit "reconnectGracefully"
 				drainedCount++
 				drainedCount++
-			if drainedCount == N
+			haveDrainedNClients = (drainedCount == N)
+			if haveDrainedNClients
 				break
 				break
 		if drainedCount < N
 		if drainedCount < N
 			logger.log "All clients have been told to reconnectGracefully"
 			logger.log "All clients have been told to reconnectGracefully"