我成功地設法https.onCall()在特定服務器位置部署了我的云功能
functions.region("europe-west6")
.https.onCall((data, context) => ...
但是當我試圖為預定函式指定一個位置時:
exports.getItems = functions.pubsub.schedule('0 6 * * *')
.region("europe-west6")
.timeZone('Europe/Zurich')
.onRun(async (context) => {
我收到:
型別錯誤:functions.pubsub.schedule(...).region 不是函式
我想知道此功能(定義自定義部署區域)是否不適用于計劃功能...
(順便說一句,在沒有.region()引數的情況下部署計劃功能也能作業)
uj5u.com熱心網友回復:
在.region()對進口存在functionsSDK本身,而不是對ScheduleBuilder由歸國.schedule(),試試這個:
exports.getItems = functions.region("europe-west6")
// after .region(''), similar to the HTTP function
.pubsub.schedule('0 6 * * *')
.timeZone('Europe/Zurich')
.onRun(async (context) => {
})
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/367530.html
標籤:javascript 节点.js 火力基地 谷歌云功能
