Skip to content

Commit

Permalink
add support for maxInstances in RuntimeOptions (#624)
Browse files Browse the repository at this point in the history
Co-authored-by: joehan <joehanley@google.com>
  • Loading branch information
efiShtain and joehan authored Mar 19, 2020
1 parent 76bfc9c commit bf52fa3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cloud-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,5 +486,9 @@ export function optionsToTrigger(options: DeploymentOptions) {
if (options.schedule) {
trigger.schedule = options.schedule;
}

if (options.maxInstances) {
trigger.maxInstances = options.maxInstances;
}
return trigger;
}
5 changes: 5 additions & 0 deletions src/function-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ export interface RuntimeOptions {
* Timeout for the function in seconds, possible values are 0 to 540.
*/
timeoutSeconds?: number;

/**
* Max number of actual instances allowed to be running in parallel
*/
maxInstances?: number;
}

export interface DeploymentOptions extends RuntimeOptions {
Expand Down

0 comments on commit bf52fa3

Please sign in to comment.