Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: firebase/firebase-functions
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.4.0
Choose a base ref
...
head repository: firebase/firebase-functions
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.5.0
Choose a head ref
  • 6 commits
  • 4 files changed
  • 5 contributors

Commits on Mar 19, 2020

  1. Copy the full SHA
    76bfc9c View commit details
  2. add support for maxInstances in RuntimeOptions (#624)

    Co-authored-by: joehan <joehanley@google.com>
    efiShtain and joehan authored Mar 19, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf52fa3 View commit details
  3. Add entry for maxInstances (#636)

    * add entry for maxInstances
    
    * prettier
    joehan authored Mar 19, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9e05b7f View commit details

Commits on Mar 20, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    df543dc View commit details
  2. Update CHANGELOG (#639)

    mbleigh authored Mar 20, 2020
    Copy the full SHA
    15bf0da View commit details
  3. 3.5.0

    google-oss-bot committed Mar 20, 2020
    Copy the full SHA
    1ed7345 View commit details
Showing with 24 additions and 8 deletions.
  1. +10 −3 CHANGELOG.md
  2. +5 −5 package.json
  3. +4 −0 src/cloud-functions.ts
  4. +5 −0 src/function-configuration.ts
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
**IMPORTANT: Please update to this version of `firebase-functions` if you are using Node.js 10 functions, otherwise your functions will break in production.**
- Adds support for defining max number of instances for a function. Example:

- Prevents deployment and runtime issues caused by upcoming changes to Cloud Functions infrastructure for Node.js 10 functions. (Issue #630)
- Adds support for writing scheduled functions under handler namespace.
```
functions.runWith({
maxInstances: 10
}).https.onRequest(...);
```

Learn more about max instances in the [Google Cloud documentation.](https://cloud.google.com/functions/docs/max-instances)

- Fixes TypeScript build error when `package-lock.json` is present by updating dependencies (Issue #637).
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firebase-functions",
"version": "3.4.0",
"version": "3.5.0",
"description": "Firebase SDK for Cloud Functions",
"keywords": [
"firebase",
@@ -38,7 +38,7 @@
"test": "mocha"
},
"dependencies": {
"@types/express": "^4.17.0",
"@types/express": "^4.17.3",
"cors": "^2.8.5",
"express": "^4.17.1",
"jsonwebtoken": "^8.5.1",
@@ -61,7 +61,7 @@
"firebase-admin": "^8.2.0",
"istanbul": "^0.4.5",
"js-yaml": "^3.13.1",
"jsdom": "^15.2.0",
"jsdom": "^16.2.1",
"mocha": "^6.1.4",
"mock-require": "^3.0.3",
"mz": "^2.7.0",
@@ -73,9 +73,9 @@
"tslint-config-prettier": "^1.18.0",
"tslint-no-unused-expression-chai": "^0.1.4",
"tslint-plugin-prettier": "^2.0.1",
"typedoc": "^0.14.2",
"typedoc": "^0.17.1",
"typescript": "^3.5.2",
"yargs": "^13.2.4"
"yargs": "^15.3.1"
},
"peerDependencies": {
"firebase-admin": "^8.0.0"
4 changes: 4 additions & 0 deletions src/cloud-functions.ts
Original file line number Diff line number Diff line change
@@ -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
@@ -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 {