Skip to content

Commit

Permalink
add failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerkesni committed Sep 28, 2023
1 parent a8146e4 commit 32b45d5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions extensions/lifecycle/tasks/LifecycleTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ class LifecycleTask extends BackbeatTask {
});
}

// eslint-disable-next-line no-param-reassign
bucketData.fail = nbRetries <= (process.env.FAIL_COUNT || 0) && process.env.FAIL_COUNT > 0;

this._compareRulesToList(bucketData, bucketLCRules,
data.Contents, log, 'Disabled', next);
},
Expand Down Expand Up @@ -1463,6 +1466,10 @@ class LifecycleTask extends BackbeatTask {
const object = Object.assign({}, obj,
{ LastModified: data.LastModified });

if (bucketData.fail) {
return done(errors.InternalError);
}

// There is an order of importance in cases of conflicts
// Expiration and NoncurrentVersionExpiration should be priority
// AbortIncompleteMultipartUpload should run regardless since
Expand Down

0 comments on commit 32b45d5

Please sign in to comment.