mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
Fix eviction error and add DRY_RUN to the archive cleaning script
This commit is contained in:
parent
70d84838df
commit
b22441446c
@ -203,7 +203,7 @@ var evictArchived = function (Env, cb) {
|
|||||||
if (Env.DRY_RUN) {
|
if (Env.DRY_RUN) {
|
||||||
if (item.channel.length === 32) { removed++; }
|
if (item.channel.length === 32) { removed++; }
|
||||||
else if (item.channel.length === 44) { accounts++; }
|
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) {
|
store.removeArchivedChannel(item.channel, w(function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@ -15,6 +15,10 @@ var config = require("../lib/load-config");
|
|||||||
|
|
||||||
var Env = Environment.create(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) {
|
var loadPremiumAccounts = function (Env, cb) {
|
||||||
nThen(function (w) {
|
nThen(function (w) {
|
||||||
// load premium accounts
|
// load premium accounts
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user