firebase-backend icon indicating copy to clipboard operation
firebase-backend copied to clipboard

functions timeout and memory allocation

Open UndefinedMamun opened this issue 2 years ago • 2 comments

Is there any way to define the timeout and memory allocation? I was looking into the source code but couldn't find anything related to this.

If this feature is not available maybe it could be in the options object along with enableCors.

UndefinedMamun avatar Sep 01 '21 18:09 UndefinedMamun

Hey, at the moment not.

If you can add that in a PR we can merge it in for you.

FilledStacks avatar Sep 30 '21 14:09 FilledStacks

@UndefinedMamun You can do something like this.

import { runWith } from 'firebase-functions'

export const functionName = runWith({
  minInstances: 2,
  memory: '2GB',
  timeoutSeconds: 30,
})
  .region('europe-west1')
  .firestore.document('users/{userId}')
  .onCreate(async snap => {})

saileshbro avatar Jul 08 '22 04:07 saileshbro