首页 > 解决方案 > 仅在特定时间运行一次 Google Cloud 函数

问题描述

我有用 nodejs 编写的作业(脚本)。

我有另一个将数据 ( Id and time-t1) 写入 Cloud Spanner 的 API。一旦 API 受到打击,我想在给定的情况下运行相同的作业并作为参数time-t1传递id

我可以在我的 API 中编写一些代码来在给定时间触发作业吗(注意 - 对于 API 作业的单次点击应该只运行一次作业)。我尝试在网上搜索,但只能找到定期调度程序。

标签: node.jsgoogle-app-enginegoogle-cloud-platform

解决方案


为了在特定的动态时间安排任务,您可以使用 Google Cloud Task 和 Google Cloud Functions 在此处阅读: https ://cloud.google.com/tasks/docs/tutorial-gcf


推荐阅读