Skip to content

Commit

Permalink
Improve variable in doWhilst
Browse files Browse the repository at this point in the history
Issue: ZENKO-4925
  • Loading branch information
williamlardier committed Nov 15, 2024
1 parent b88d962 commit 88384bc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/zenko_tests/node_tests/backbeat/ReplicationUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ class ReplicationUtility {

// Continue getting head object while the status is PENDING or PROCESSING.
waitUntilReplicated(bucketName, key, versionId, cb) {
let status;
return async.doWhilst(
callback => this.s3.headObject({
Bucket: bucketName,
Expand All @@ -601,18 +600,18 @@ class ReplicationUtility {
if (err) {
return cbOnce(err);
}
status = data.ReplicationStatus;
const status = data.ReplicationStatus;
assert.notStrictEqual(
status,
'FAILED',
`Unexpected CRR failure occurred: ${JSON.stringify(data)}`,
);
if (status === 'PENDING' || status === 'PROCESSING') {
return setTimeout(cbOnce, 2000);
return setTimeout(() => cbOnce(null, status), 2000);
}
return cbOnce();
return cbOnce(null, status);
}),
() => (status === 'PENDING' || status === 'PROCESSING'),
status => (status === 'PENDING' || status === 'PROCESSING'),
cb,
);
}
Expand Down

0 comments on commit 88384bc

Please sign in to comment.