mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
reduce RAD chunk and try JSON serializing
This commit is contained in:
parent
382cbc4798
commit
4de57d4014
5
gun.js
5
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);
|
||||
|
@ -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) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user