2

I successfully managed to deploy my https.onCall() cloud functions on a specific server location with

functions.region("europe-west6")
.https.onCall((data, context) => ...

But when I tried to specify a location for scheduled function:

   exports.getItems = functions.pubsub.schedule('0 6 * * *')
  .region("europe-west6")
  .timeZone('Europe/Zurich')
  .onRun(async (context) => {

I receive:

TypeError: functions.pubsub.schedule(...).region is not a function

I wonder if this functionality (defining custom deploy region) is not available for scheduled functions...

(btw deploying the scheduled function worked without the .region() parameter)

1 Answer 1

2

The .region() exists on imported functions SDK itself and not on the ScheduleBuilder returned by .schedule(), try this:

exports.getItems = functions.region("europe-west6")
  // after .region(''), similar to the HTTP function
  .pubsub.schedule('0 6 * * *')  
  .timeZone('Europe/Zurich')
  .onRun(async (context) => {

  })
Sign up to request clarification or add additional context in comments.

1 Comment

Oh thank you very much! how could I miss that..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.