@@ -54,6 +54,10 @@ class OpenWhiskCompileFunctions {
5454 return functionObject . memory || this . serverless . service . provider . memory || 256 ;
5555 }
5656
57+ calculateConcurrency ( functionObject ) {
58+ return functionObject . concurrency || this . serverless . service . provider . concurrency || 1 ;
59+ }
60+
5761 calculateTimeout ( functionObject ) {
5862 return functionObject . timeout || this . serverless . service . provider . timeout || 60 ;
5963 }
@@ -77,7 +81,11 @@ class OpenWhiskCompileFunctions {
7781 overwrite : params . Overwrite ,
7882 action : {
7983 exec : params . Exec ,
80- limits : { timeout : params . Timeout * 1000 , memory : params . MemorySize } ,
84+ limits : {
85+ timeout : params . Timeout * 1000 ,
86+ memory : params . MemorySize ,
87+ concurrency : params . Concurrency ,
88+ } ,
8189 parameters : params . Parameters ,
8290 annotations : params . Annotations
8391 } ,
@@ -99,6 +107,7 @@ class OpenWhiskCompileFunctions {
99107 const MemorySize = this . calculateMemorySize ( functionObject ) ;
100108 const Timeout = this . calculateTimeout ( functionObject ) ;
101109 const Overwrite = this . calculateOverwrite ( functionObject ) ;
110+ const Concurrency = this . calculateConcurrency ( functionObject ) ;
102111
103112 // optional action parameters
104113 const Parameters = Object . keys ( functionObject . parameters || { } )
@@ -108,7 +117,7 @@ class OpenWhiskCompileFunctions {
108117 const Annotations = this . constructAnnotations ( functionObject . annotations ) ;
109118
110119 return this . compileFunctionAction (
111- { FunctionName, NameSpace, Overwrite, Exec, Timeout, MemorySize, Parameters, Annotations }
120+ { FunctionName, NameSpace, Overwrite, Exec, Timeout, MemorySize, Concurrency , Parameters, Annotations }
112121 ) ;
113122 } ) ;
114123 }
0 commit comments