我在使用node-cron库的node/express应用程序中执行cron作业时遇到问题。该应用程序部署在Google Cloud App Engine上。
我想每天上午9点自动发送电子邮件,但cron只在周一到周五工作。
下面是我的代码:
cron.schedule("0 9 * * *", () => {
sendEmails();
},{
scheduled: true,
timezone: "Europe/Paris"
});谢谢
发布于 2020-04-28 16:55:32
如果没有流量,App Engine标准将缩减到0个实例,如果发生在周六/周日上午9点,没有任何实例Node cron作业不会执行的情况。
你查过cron.yaml了吗。这是在App Engine中调度cron作业的首选方法吗?sheduling job如下所示:
# cron.yaml
cron:
- description: "daily summary job"
url: /tasks/sendemail
schedule: every day 09:00
# end cron.yaml其中schedule: every day 09:00是指定的custom interval
https://stackoverflow.com/questions/61455376
复制相似问题