New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert reservedConcurrency to integer to allow use env var #5705

Merged
merged 1 commit into from Jan 23, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+6 −3
Diff settings

Always

Just for now

@@ -299,8 +299,11 @@ class AwsCompileFunctions {
} }


if (functionObject.reservedConcurrency || functionObject.reservedConcurrency === 0) { if (functionObject.reservedConcurrency || functionObject.reservedConcurrency === 0) {
if (_.isInteger(functionObject.reservedConcurrency)) { // Try convert reservedConcurrency to integer
newFunction.Properties.ReservedConcurrentExecutions = functionObject.reservedConcurrency; const reservedConcurrency = _.parseInt(functionObject.reservedConcurrency);

if (_.isInteger(reservedConcurrency)) {
newFunction.Properties.ReservedConcurrentExecutions = reservedConcurrency;
} else { } else {
const errorMessage = [ const errorMessage = [
'You should use integer as reservedConcurrency value on function: ', 'You should use integer as reservedConcurrency value on function: ',
@@ -1976,7 +1976,7 @@ describe('AwsCompileFunctions', () => {
func: { func: {
handler: 'func.function.handler', handler: 'func.function.handler',
name: 'new-service-dev-func', name: 'new-service-dev-func',
reservedConcurrency: '1', reservedConcurrency: 'a',
}, },
}; };


ProTip! Use n and p to navigate between commits in a pull request.