compare live blob activity against 'inactiveTime' instead of 'retentionTime' which is intended for archived content expiration

pull/1/head
ansuz 5 years ago
parent 7d15583b0e
commit c9846e532b

@ -175,8 +175,12 @@ nThen(function (w) {
Log.error("EVICT_BLOB_LIST_BLOBS_ERROR", err); Log.error("EVICT_BLOB_LIST_BLOBS_ERROR", err);
return void next(); 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 (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) { blobs.archive.blob(item.blobId, function (err) {
if (err) { if (err) {
@ -204,8 +208,12 @@ nThen(function (w) {
next(); next();
return void Log.error("EVICT_BLOB_LIST_PROOFS_ERROR", err); 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 (pins[item.blobId]) { return void next(); }
if (item && getNewestTime(item) > retentionTime) { return void next(); } if (getNewestTime(item) > inactiveTime) { return void next(); }
nThen(function (w) { nThen(function (w) {
blobs.size(item.blobId, w(function (err, size) { blobs.size(item.blobId, w(function (err, size) {
if (err) { if (err) {

Loading…
Cancel
Save