Merge pull request #899 from bluelovers/pr/002

chore: fix log
This commit is contained in:
Mark Nadal 2020-02-11 14:51:36 -08:00 committed by GitHub
commit 2801198691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,7 +299,7 @@
Q[g.file] = [{key: key, ack: cb, file: g.file, opt: o}];
if(!g.file){
g.it(null, u, {});
return true;
return true;
}
r.parse(g.file, g.check);
return true;
@ -333,14 +333,14 @@
){
o.more = u;
as.ack(g.err, data, o);
return
return
}
if(u !== data){
var S = +new Date;
as.ack(g.err, data, o); // more might be coming!
LOG && opt.log(S, +new Date - S, 'rad range ack.'); // 1.4s
if(o.parsed >= o.limit){ return } // even if more, we've hit our limit, asking peer will need to make a new ask with a new starting point.
}
}
o.next = as.file;
r.read(key, as.ack, o);
}
@ -360,10 +360,10 @@
r.list(go);
});
if(good){ return }
var id = Gun.text.random(3); console.log("MISLOCATED DATA", id);
var id = Gun.text.random(3); opt.log("MISLOCATED DATA", id);
r.save(disk, function ack(err, ok){
if(err){ return r.save(disk, ack) } // ad infinitum???
console.log("MISLOCATED CORRECTED", id);
opt.log("MISLOCATED CORRECTED", id);
});
}
/*g.check2 = function(err, disk, info){
@ -478,7 +478,7 @@
l[2] = t.slice(i + o.i);
return l;
}
p.ack = function(cb){
p.ack = function(cb){
if(!cb){ return }
if(p.err || p.not){ return cb(p.err, u, info) }
cb(u, p.disk, info);
@ -618,7 +618,7 @@
var Gun = window.Gun;
var Radix = window.Radix;
window.Radisk = Radisk;
} else {
} else {
var Gun = require('../gun');
var Radix = require('./radix');
//var Radix = require('./radix2'); Radisk = require('./radisk2');
@ -627,4 +627,4 @@
Radisk.Radix = Radix;
}());
}());