Merge pull request #407 from sjones6/config_timeout

enable ack delay
This commit is contained in:
Mark Nadal 2017-08-28 12:32:21 -07:00 committed by GitHub
commit 08e239ee2d

4
gun.js
View File

@ -765,11 +765,11 @@
if(!this.on){ return } if(!this.on){ return }
var id = text_rand(9); var id = text_rand(9);
if(cb){ if(cb){
var to = this.on(id, cb, as); var to = this.on(id, cb, as), lack = (this.gun._.opt.lack || 9000);
to.err = setTimeout(function(){ to.err = setTimeout(function(){
to.next({err: "Error: No ACK received yet."}); to.next({err: "Error: No ACK received yet."});
to.off(); to.off();
}, 1000 * 9); // TODO: Make configurable!!! }, lack < 1000 ? 1000 : lack);
} }
return id; return id;
} }