【问题标题】:Unable to change Cloud scheduler timezone for PubSub Cloud Function deploy via CICD无法更改通过 CICD 部署的 PubSub Cloud Function 部署的云调度程序时区
【发布时间】:2021-05-30 15:10:23
【问题描述】:

调度程序的时区突然开始回退到默认的“America/Los_Angelos” 查看以下来自 firebase 文档的示例(参考:https://firebase.google.com/docs/functions/schedule-functions#write_a_scheduled_function)

exports.scheduledFunctionCrontab = functions.pubsub.schedule('0 11 * * *')
  .timeZone('America/New_York') // Users can choose timezone - default is America/Los_Angeles
  .onRun((context) => {
  console.log('This will be run every day at 11:05 AM Eastern!');
  return null;
});

不幸的是,通过我们的 CI 管道进行的所有新部署的 timeZone 开始失败,并且计划的作业在太平洋时间上午 11:00 开始运行,而不是预期的东部时间上午 11:00。

尝试更新 CI 管道中的节点,包中的 firebase-admin,但没有任何帮助...

【问题讨论】:

    标签: firebase google-cloud-functions firebase-tools


    【解决方案1】:

    经过所有分析,我们了解到我们的 Git CI 管道中有 firebase-tools 来调用部署命令。 它总是安装最新的 firebase-tools npm 模块。 最近这个包有一个更新(参考:https://www.npmjs.com/package/firebase-tools)

    在这次更新之后,无论何时运行管道,timeZone 都不会被设置为任何值(“America/Costa_Rica”、“America/New_York”等)

    最后,在管道中将 firebase-tools 版本设置回“9.6.1”,使其工作。

    - npm install -g firebase-tools@9.6.1
    

    希望它能帮助某人,谷歌很快就会解决这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-30
      • 1970-01-01
      • 2022-12-12
      • 2022-07-15
      • 2020-05-30
      • 2020-09-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多