add the ability to filter for old pads using pinneddata.js
This commit is contained in:
parent
809b56625d
commit
fe2454ba31
@ -117,8 +117,17 @@ nThen((waitFor) => {
|
|||||||
});
|
});
|
||||||
}).nThen(() => {
|
}).nThen(() => {
|
||||||
if (process.argv.indexOf('--unpinned') > -1) {
|
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) => {
|
Object.keys(dsFileStats).forEach((f) => {
|
||||||
if (!(f in pinned)) {
|
if (!(f in pinned)) {
|
||||||
|
if ((+dsFileStats[f].mtime) >= before) { return; }
|
||||||
console.log("./datastore/" + f.slice(0,2) + "/" + f + ".ndjson " +
|
console.log("./datastore/" + f.slice(0,2) + "/" + f + ".ndjson " +
|
||||||
dsFileStats[f].size + " " + (+dsFileStats[f].mtime));
|
dsFileStats[f].size + " " + (+dsFileStats[f].mtime));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user