mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
Switch maxAttempts from a query param to an option Fixes #73
This commit is contained in:
parent
2cf975b9f6
commit
94815a247d
3 changed files with 6 additions and 5 deletions
|
|
@ -10,9 +10,9 @@ class Core extends EventEmitter {
|
|||
super();
|
||||
this.options = {
|
||||
tcpTimeout: 1000,
|
||||
udpTimeout: 1000
|
||||
udpTimeout: 1000,
|
||||
maxAttempts: 1
|
||||
};
|
||||
this.maxAttempts = 1;
|
||||
this.attempt = 1;
|
||||
this.finished = false;
|
||||
this.encoding = 'utf8';
|
||||
|
|
@ -26,7 +26,7 @@ class Core extends EventEmitter {
|
|||
}
|
||||
|
||||
fatal(err,noretry) {
|
||||
if(!noretry && this.attempt < this.maxAttempts) {
|
||||
if(!noretry && this.attempt < this.options.maxAttempts) {
|
||||
this.attempt++;
|
||||
this.start();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue