Просмотр исходного кода

send messages to clients with concurrency of 2

Shane Kilkelly 7 лет назад
Родитель
Сommit
2cc2be3d9c
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      services/real-time/app/coffee/WebsocketLoadBalancer.coffee

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

@@ -91,7 +91,8 @@ module.exports = WebsocketLoadBalancer =
 				}, "distributing event to clients"
 				seen = {}
 				# Send the messages to clients async, don't wait for them all to finish
-				Async.eachSeries clientList
+				Async.eachLimit clientList
+					, 2
 					, (client, cb) ->
 						Utils.getClientAttributes client, ['is_restricted_user'], (err, {is_restricted_user}) ->
 							return cb(err) if err?