gpt4 book ai didi

firebase - Cloud Functions for Firebase Scheduler 的时区没有改变

转载 作者:行者123 更新时间:2023-12-02 02:11:13 26 4
gpt4 key购买 nike

我目前正在为 Firebase 调度程序创建和部署要在 Cloud Functions 中定期执行的函数,如下所示。关键是我希望它在日本时间每天 0:05 作为 .timeZone('Asia/Tokyo') 执行。

部署本身工作正常,但是当我查看 GCP 的 Cloud Scheduler 中的内容时,时区设置为 (America/LosAngeles),如下图所示,实际执行时间与日本时间有偏差.

我在 Cloud Scheduler 功能管理屏幕中手动将时区更改为日本时间,并确认实现了所需的行为,但是当我再次部署该功能时,它仍然设置为(美国/洛杉矶)。

我以为可能是受GCP本身区域的影响,我得改GCP的区域,但我还没找到可以从哪里改。但是,我认为我应该能够从代码中为每个函数指定 .timeZone。我很茫然。

我不知道如何解决这个问题,我想知道是否有人可以帮助我。

exports.XXX = functions.pubsub
.schedule('every day 0:05')
.timeZone('Asia/Tokyo')
.onRun((context) => {
///省略
});

enter image description here

提前谢谢你。

最佳答案

我也遇到过同样的问题。还有一个类似的问题问here降级 firebase-tools 的解决方案对我有用。

关于firebase - Cloud Functions for Firebase Scheduler 的时区没有改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67731532/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com