@@ -54,6 +54,10 @@ class OpenWhiskCompileFunctions {
54
54
return functionObject . memory || this . serverless . service . provider . memory || 256 ;
55
55
}
56
56
57
+ calculateConcurrency ( functionObject ) {
58
+ return functionObject . concurrency || this . serverless . service . provider . concurrency || 1 ;
59
+ }
60
+
57
61
calculateTimeout ( functionObject ) {
58
62
return functionObject . timeout || this . serverless . service . provider . timeout || 60 ;
59
63
}
@@ -77,7 +81,11 @@ class OpenWhiskCompileFunctions {
77
81
overwrite : params . Overwrite ,
78
82
action : {
79
83
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
+ } ,
81
89
parameters : params . Parameters ,
82
90
annotations : params . Annotations
83
91
} ,
@@ -99,6 +107,7 @@ class OpenWhiskCompileFunctions {
99
107
const MemorySize = this . calculateMemorySize ( functionObject ) ;
100
108
const Timeout = this . calculateTimeout ( functionObject ) ;
101
109
const Overwrite = this . calculateOverwrite ( functionObject ) ;
110
+ const Concurrency = this . calculateConcurrency ( functionObject ) ;
102
111
103
112
// optional action parameters
104
113
const Parameters = Object . keys ( functionObject . parameters || { } )
@@ -108,7 +117,7 @@ class OpenWhiskCompileFunctions {
108
117
const Annotations = this . constructAnnotations ( functionObject . annotations ) ;
109
118
110
119
return this . compileFunctionAction (
111
- { FunctionName, NameSpace, Overwrite, Exec, Timeout, MemorySize, Parameters, Annotations }
120
+ { FunctionName, NameSpace, Overwrite, Exec, Timeout, MemorySize, Concurrency , Parameters, Annotations }
112
121
) ;
113
122
} ) ;
114
123
}
0 commit comments