Switch maxAttempts from a query param to an option Fixes #73

This commit is contained in:
mmorrison 2018-01-31 00:41:57 -06:00
parent 2cf975b9f6
commit 94815a247d
3 changed files with 6 additions and 5 deletions

View file

@ -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;