add the ability to filter for old pads using pinneddata.js

pull/1/head
Caleb James DeLisle 7 years ago
parent 809b56625d
commit fe2454ba31

@ -117,8 +117,17 @@ nThen((waitFor) => {
});
}).nThen(() => {
if (process.argv.indexOf('--unpinned') > -1) {
const ot = process.argv.indexOf('--olderthan');
let before = 0;
if (ot > -1) {
before = new Date(process.argv[ot+1]);
if (isNaN(before)) {
throw new Error('--olderthan error [' + process.argv[ot+1] + '] not a valid date');
}
}
Object.keys(dsFileStats).forEach((f) => {
if (!(f in pinned)) {
if ((+dsFileStats[f].mtime) >= before) { return; }
console.log("./datastore/" + f.slice(0,2) + "/" + f + ".ndjson " +
dsFileStats[f].size + " " + (+dsFileStats[f].mtime));
}

Loading…
Cancel
Save