From b22441446c829aec5613cbd1788d57e6fd952b40 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 8 Jan 2024 14:12:04 +0100 Subject: [PATCH] Fix eviction error and add DRY_RUN to the archive cleaning script --- lib/eviction.js | 2 +- scripts/evict-archived.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/eviction.js b/lib/eviction.js index 42afbc2c5..12aaeff0f 100644 --- a/lib/eviction.js +++ b/lib/eviction.js @@ -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) { diff --git a/scripts/evict-archived.js b/scripts/evict-archived.js index 124ebc30c..6914c90ad 100644 --- a/scripts/evict-archived.js +++ b/scripts/evict-archived.js @@ -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