Skip to content

Commit

Permalink
razeedeploy-core 1.3.3 for list hang fix and split requests (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
carrolp authored Dec 1, 2022
1 parent 3c6d5ee commit f50dcfd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"license": "Apache-2.0",
"dependencies": {
"@razee/kubernetes-util": "^1.1.0",
"@razee/razeedeploy-core": "^1.3.2",
"@razee/razeedeploy-core": "^1.3.3",
"axios": "^0.27.2",
"bunyan": "^1.8.15",
"clone": "^2.1.2",
Expand Down
6 changes: 4 additions & 2 deletions src/RemoteResourceGitController.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const loggerFactory = require('./bunyan-api');
const objectPath = require('object-path');
const request = require('request-promise-native');
const clone = require('clone');
const hash = require('object-hash');

const { BaseDownloadController } = require('@razee/razeedeploy-core');

Expand Down Expand Up @@ -48,7 +49,7 @@ module.exports = class RemoteResourceGitController extends BaseDownloadControlle
let reqOpt = clone(req.options);
const optional = req.optional || false;
const gitinfo = objectPath.get(req, 'options.git');

if (gitinfo) {
try {
reqOpt = await this._fetchHeaderSecrets(reqOpt);
Expand Down Expand Up @@ -77,6 +78,7 @@ module.exports = class RemoteResourceGitController extends BaseDownloadControlle
reqOpt = git.getAddlHeaders(reqOpt);
const newReq = clone(req);
newReq.options = reqOpt;
newReq.splitRequestId = hash(req); // By setting splitRequestId, all requests split from a single original request will all be attempted before allowing failures to abort
newRequests.push(newReq);
}
}
Expand All @@ -94,7 +96,7 @@ module.exports = class RemoteResourceGitController extends BaseDownloadControlle
newRequests.push(req);
}
}

if (newRequests.length > 0) {
objectPath.set(this.data, ['object', 'spec', 'requests'], newRequests);
let result = await super.added();
Expand Down
1 change: 1 addition & 0 deletions src/RemoteResourceS3Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module.exports = class RemoteResourceS3Controller extends BaseDownloadController
const url = new URL(objectPath.get(r, 'options.url'));
if (url.pathname.endsWith('/')) { //This is an S3 bucket
let additionalRequests = await this._getBucketObjectRequestList(r);
additionalRequests.forEach( newReq => newReq.splitRequestId = hash(r) ); // By setting splitRequestId, all requests split from a single original request will all be attempted before allowing failures to abort
newRequests = newRequests.concat(additionalRequests);
} else {
newRequests.push(r);
Expand Down

0 comments on commit f50dcfd

Please sign in to comment.