From c9846e532bc27bca85ebba5d4e156568ffe5e5b6 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 4 May 2020 15:40:51 -0400 Subject: [PATCH] compare live blob activity against 'inactiveTime' instead of 'retentionTime' which is intended for archived content expiration --- scripts/evict-inactive.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/evict-inactive.js b/scripts/evict-inactive.js index 1d7b87e91..4455d7c35 100644 --- a/scripts/evict-inactive.js +++ b/scripts/evict-inactive.js @@ -175,8 +175,12 @@ nThen(function (w) { Log.error("EVICT_BLOB_LIST_BLOBS_ERROR", err); return void next(); } + if (!item) { + next(); + return void Log.error('EVICT_BLOB_LIST_BLOBS_NO_ITEM', item); + } if (pins[item.blobId]) { return void next(); } - if (item && getNewestTime(item) > retentionTime) { return void next(); } + if (getNewestTime(item) > inactiveTime) { return void next(); } blobs.archive.blob(item.blobId, function (err) { if (err) { @@ -204,8 +208,12 @@ nThen(function (w) { next(); return void Log.error("EVICT_BLOB_LIST_PROOFS_ERROR", err); } + if (!item) { + next(); + return void Log.error('EVICT_BLOB_LIST_PROOFS_NO_ITEM', item); + } if (pins[item.blobId]) { return void next(); } - if (item && getNewestTime(item) > retentionTime) { return void next(); } + if (getNewestTime(item) > inactiveTime) { return void next(); } nThen(function (w) { blobs.size(item.blobId, w(function (err, size) { if (err) {