fix large records saving to RAD

This commit is contained in:
Mark Nadal 2020-02-21 22:39:06 -08:00
parent 50a7373d00
commit 79fac4cb45

View File

@ -200,7 +200,15 @@
try{raw = JSON.stringify(rad.$);
}catch(e){ cb("Cannot radisk!"); return }
console.STAT && console.STAT(S, +new Date - S, "rad stringified JSON");
if(opt.chunk < raw.length && !o.force){ return f.split() }
if(opt.chunk < raw.length && !o.force){
var c = 0;
Radix.map(rad, function(){
if(c++){ return true } // more than 1 item
});
if(c > 1){
return f.split();
}
}
f.text = raw;
f.write();
}
@ -272,7 +280,7 @@
});
})
});
console.STAT && console.STAT(S, ST - S, "rad check");
console.STAT && console.STAT(S, +new Date - S, "rad check");
}
r.find(key, g.find);
}