diff --git a/gun.js b/gun.js index 04e072f8..c3ea73ab 100644 --- a/gun.js +++ b/gun.js @@ -2027,7 +2027,7 @@ if(this.to){ this.to.next(msg) } // compatible with middleware adapters. if(!msg){ return false } var id, hash, tmp, raw; - var S = +new Date; // msg.DBG_s = msg.DBG_s || +new Date; + var S = +new Date; //msg.DBG_s = msg.DBG_s || +new Date; var meta = msg._||(msg._=function(){}); if(!(id = msg['#'])){ id = msg['#'] = Type.text.random(9) } if(!(hash = msg['##']) && u !== msg.put){ hash = msg['##'] = Type.obj.hash(msg.put) } @@ -2262,7 +2262,6 @@ wire.onerror = function(error){ reconnect(peer); }; - // it can take a while to open a socket, maybe no longer lazy load for perf reasons? wire.onopen = function(){ opt.mesh.hi(peer); } @@ -2273,6 +2272,8 @@ return wire; }catch(e){}} + setTimeout(function(){ root.on('out', {dam:'hi'}) },1); // it can take a while to open a socket, so maybe no longer lazy load for perf reasons? + var wait = 2 * 1000; function reconnect(peer){ clearTimeout(peer.defer); diff --git a/lib/radisk.js b/lib/radisk.js index e918e6ce..c462b9ed 100644 --- a/lib/radisk.js +++ b/lib/radisk.js @@ -11,10 +11,10 @@ opt.pack = opt.pack || (opt.memory? (opt.memory * 1000 * 1000) : 1399000000) * 0.3; // max_old_space_size defaults to 1400 MB. opt.until = opt.until || opt.wait || 250; opt.batch = opt.batch || (10 * 1000); - opt.chunk = opt.chunk || (1024 * 1024 * 10); // 10MB + opt.chunk = opt.chunk || (1024 * 1024 * 1); // 1MB opt.code = opt.code || {}; opt.code.from = opt.code.from || '!'; - //opt.jsonify = true; if(opt.jsonify){ console.log("JSON RAD!!!") } // TODO: REMOVE!!!! + opt.jsonify = true; function ename(t){ return encodeURIComponent(t).replace(/\*/g, '%2A') } function atomic(v){ return u !== v && (!v || 'object' != typeof v) }