oops, forgot I played with ascii

This commit is contained in:
Mark Nadal 2021-08-21 02:33:58 -07:00
parent 2cb642bd7f
commit e300a12f30
3 changed files with 14 additions and 6 deletions

2
gun.js
View File

@ -395,7 +395,7 @@
if(!(tmp = id._)){ /*console.log("TODO: handle ack id.");*/ return }
tmp.acks = (tmp.acks||0) + 1;
if(0 == tmp.stun && tmp.acks == tmp.all){ // TODO: if ack is synchronous this may not work?
root && root.on('in', {'@': tmp['#'], err: msg.err, ok: 'shard'});
root && root.on('in', {'@': tmp['#'], err: msg.err, ok: msg.err? u : 'shard'});
return;
}
if(msg.err){ msg['@'] = tmp['#'] }

View File

@ -7,7 +7,7 @@ Gun.on('create', function(root){
if(false === opt.rad || false === opt.radisk){ return }
var Radisk = (Gun.window && Gun.window.Radisk) || require('./radisk');
var Radix = Radisk.Radix;
var dare = Radisk(opt), esc = String.fromCharCode(26);
var dare = Radisk(opt), esc = String.fromCharCode(27);
var ST = 0;
root.on('put', function(msg){
@ -17,10 +17,10 @@ Gun.on('create', function(root){
var DBG = (msg._||'').DBG; DBG && (DBG.sp = DBG.sp || +new Date);
//var lot = (msg._||'').lot||''; count[id] = (count[id] || 0) + 1;
var S = (msg._||'').RPS || ((msg._||'').RPS = +new Date);
//console.only.i && console.log("PUT ------->>>", soul,key, val, state);
//console.log("PUT ------->>>", soul,key, val, state);
//dare(soul+esc+key, {':': val, '>': state}, dare.one[id] || function(err, ok){
dare(soul+esc+key, {':': val, '>': state}, function(err, ok){
//console.only.i && console.log("<<<------- PAT", soul,key, val, state, 'in', +new Date - S);
//console.log("<<<------- PAT", soul,key, val, state, 'in', +new Date - S);
DBG && (DBG.spd = DBG.spd || +new Date);
console.STAT && console.STAT(S, +new Date - S, 'put');
//if(!err && count[id] !== lot.s){ console.log(err = "Disk count not same as ram count."); console.STAT && console.STAT(+new Date, lot.s - count[id], 'put ack != count') } delete count[id];
@ -71,9 +71,9 @@ Gun.on('create', function(root){
var now = Gun.state();
var S = (+new Date), C = 0, SPT = 0; // STATS!
DBG && (DBG.sgm = S);
//var GID = String.random(3); console.only.i && console.log("GET ------->>>", GID, key, o, '?', get);
//var GID = String.random(3); console.log("GET ------->>>", GID, key, o, '?', get);
dare(key||'', function(err, data, info){
//console.only.i && console.log("<<<------- GOT", GID, err, data);
//console.log("<<<------- GOT", GID, +new Date - S, err, data);
DBG && (DBG.sgr = +new Date);
DBG && (DBG.sgi = info);
try{opt.store.stats.get.time[statg % 50] = (+new Date) - S; ++statg;

8
test/rad/2020and2021.js Normal file
View File

@ -0,0 +1,8 @@
var Gun = require('../../index');
var gun = Gun({file: __dirname+'/old2020json'});
gun.get('test').once(function(data, key){
console.log(key, data);
if(!data){ throw "not compatible!" }
});