From 67121de7a28f01610f8b940923781714ed4edb2f Mon Sep 17 00:00:00 2001 From: sjones6 Date: Tue, 22 Aug 2017 20:46:45 -0400 Subject: [PATCH] enable ack delay --- gun.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gun.js b/gun.js index a8dba928..14e2e427 100644 --- a/gun.js +++ b/gun.js @@ -765,11 +765,11 @@ if(!this.on){ return } var id = text_rand(9); if(cb){ - var to = this.on(id, cb, as); + var to = this.on(id, cb, as), delay = (this.gun._.opt.ackDelay || 9); to.err = setTimeout(function(){ to.next({err: "Error: No ACK received yet."}); to.off(); - }, 1000 * 9); // TODO: Make configurable!!! + }, 1000 * (delay < 1 ? 1 : delay)); } return id; }