Add a 500ms between network connections, to prevent hitting operating system rate limiting.
This commit is contained in:
parent
6bcbe1b702
commit
b32520b1f9
|
@ -54,8 +54,15 @@ function Client(sockets, config) {
|
|||
});
|
||||
if (config) {
|
||||
var client = this;
|
||||
var wait_total = 0;
|
||||
_.each(config.networks || [], function(n) {
|
||||
client.connect(n);
|
||||
if (wait_total == 0)
|
||||
client.connect(n);
|
||||
else
|
||||
setTimeout(function() {
|
||||
client.connect(n);
|
||||
}, wait_total);
|
||||
wait_total += 500;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue