Skip to content

Commit

Permalink
fix: the missing artifactsMaxDownloadSize (#3237)
Browse files Browse the repository at this point in the history
  • Loading branch information
VonnyJap authored Nov 5, 2024
1 parent 03303f6 commit 2815209
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bin/server
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const queueWebhookEnabled = convertToBool(config.get('queueWebhook').enabled);
// Default cluster environment variable
const clusterEnvConfig = config.get('build').environment; // readonly
const clusterEnv = { ...clusterEnvConfig };
const artifactsMaxDownloadSize = config.get('build').artifacts.maxDownloadSize;

Object.keys(clusterEnv).forEach(k => {
clusterEnv[k] = String(clusterEnv[k]);
Expand Down Expand Up @@ -304,7 +305,8 @@ datastore.setup(datastoreConfig.ddlSyncEnabled).then(() =>
executor,
queueWebhookEnabled
},
unzipArtifactsEnabled
unzipArtifactsEnabled,
artifactsMaxDownloadSize
})
.then(instance => logger.info('Server running at %s', instance.info.uri))
.catch(err => {
Expand Down
4 changes: 2 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function prettyPrintErrors(request, h) {
* @param {Object} config.builds.authConfig Configuration for auth
* @param {Object} config.builds.externalJoin Flag to allow external join
* @param {Object} config.unzipArtifactsEnabled Flag to allow unzip artifacts
* @param {Object} config.artifactsMaxDownloadSize Maximum download size for artifacts
* @param {Function} callback Callback to invoke when server has started.
* @return {http.Server} A listener: NodeJS http.Server object
*/
Expand Down Expand Up @@ -211,8 +212,7 @@ module.exports = async config => {
expiresIn
);
server.app.buildFactory.executor.tokenGen = server.app.buildFactory.tokenGen;
server.app.buildFactory.maxDownloadSize =
parseInt(config.build.artifacts.maxDownloadSize, 10) * 1024 * 1024 * 1024;
server.app.buildFactory.maxDownloadSize = parseInt(config.artifactsMaxDownloadSize, 10) * 1024 * 1024 * 1024;

server.app.jobFactory.apiUri = server.info.uri;
server.app.jobFactory.tokenGen = (username, metadata, scmContext, scope = ['user']) =>
Expand Down

0 comments on commit 2815209

Please sign in to comment.