Fix eviction error and add DRY_RUN to the archive cleaning script

This commit is contained in:
yflory 2024-01-08 14:12:04 +01:00
parent 70d84838df
commit b22441446c
2 changed files with 5 additions and 1 deletions

View File

@ -203,7 +203,7 @@ var evictArchived = function (Env, cb) {
if (Env.DRY_RUN) {
if (item.channel.length === 32) { removed++; }
else if (item.channel.length === 44) { accounts++; }
return void Log.info("EVICT_ARCHIVED_CHANNEL_DRY_RUN", item.channel, next);
return void Log.info("EVICT_ARCHIVED_CHANNEL_DRY_RUN", item.channel, cb);
}
store.removeArchivedChannel(item.channel, w(function (err) {
if (err) {

View File

@ -15,6 +15,10 @@ var config = require("../lib/load-config");
var Env = Environment.create(config);
// Set DRY_RUN to true to run the script without deleting anything. A log file
// will be created.
Env.DRY_RUN = false;
var loadPremiumAccounts = function (Env, cb) {
nThen(function (w) {
// load premium accounts