use configured paths in scripts instead of hardcoded strings

This commit is contained in:
ansuz
2019-04-12 17:16:32 +02:00
parent 36637c4a7f
commit c3d52e87b9
6 changed files with 41 additions and 19 deletions

View File

@@ -5,9 +5,9 @@ const Saferphore = require("saferphore");
const PinnedData = require('./pinneddata');
let config;
try {
config = require('../config/config');
config = require('./config/config');
} catch (e) {
config = require('../config/config.example');
config = require('./config/config.example');
}
if (!config.inactiveTime || typeof(config.inactiveTime) !== "number") { return; }
@@ -16,7 +16,11 @@ let inactiveTime = +new Date() - (config.inactiveTime * 24 * 3600 * 1000);
let inactiveConfig = {
unpinned: true,
olderthan: inactiveTime,
blobsolderthan: inactiveTime
blobsolderthan: inactiveTime,
filePath: config.filePath,
blobPath: config.blobPath,
pinPath: config.pinPath,
};
let toDelete;
nThen(function (waitFor) {