mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
check if migration needed
This commit is contained in:
parent
9de7d0f38d
commit
4163687acb
@ -294,9 +294,10 @@
|
||||
if(o.parsed >= o.limit){ return }
|
||||
var S = +new Date;
|
||||
DBG && (DBG.rm = S);
|
||||
var next = o.next;
|
||||
timediate(function(){
|
||||
console.STAT && console.STAT(S, +new Date - S, 'rad more');
|
||||
r.parse(o.next, g.check);
|
||||
r.parse(next, g.check);
|
||||
},0);
|
||||
}
|
||||
g.check = function(err, disk, info){
|
||||
@ -498,6 +499,8 @@
|
||||
}
|
||||
}());
|
||||
|
||||
try{ !Gun.window && require('./radmigtmp')(r) }catch(e){}
|
||||
|
||||
var noop = function(){}, RAD, u;
|
||||
Radisk.has[opt.file] = r;
|
||||
return r;
|
||||
|
22
lib/radmigtmp.js
Normal file
22
lib/radmigtmp.js
Normal file
@ -0,0 +1,22 @@
|
||||
module.exports = function(r){
|
||||
var Radix = require('./radix');
|
||||
r.find('a', function(){
|
||||
var l = [];
|
||||
Radix.map(r.list, function(v,f){
|
||||
if(!(f.indexOf('%1B') + 1)){ return }
|
||||
if(!v){ return }
|
||||
l.push([f,v]);
|
||||
});
|
||||
if(l.length){
|
||||
console.log("\n! ! ! WARNING ! ! !\nRAD v0.2020.x has detected OLD v0.2019.x data & automatically migrating. Automatic migration will be turned OFF in future versions! If you are just developing/testing, we recommend you reset your data. Please contact us if you have any concerns.\nThis message should only log once.")
|
||||
}
|
||||
var f, v;
|
||||
l.forEach(function(a){
|
||||
f = a[0]; v = a[1];
|
||||
r.list(decodeURIComponent(f), v);
|
||||
r.list(f, 0);
|
||||
});
|
||||
if(!f){ return }
|
||||
r.find.bad(f);
|
||||
})
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user