Aws Elastic Beanstalk 不执行 cron.yaml 文件



我目前在项目的根目录中有一个文件 cron.yaml。

version: 3
cron:
- name: "shopify"
url: "/shopify"
schedule: "0 * * * *"
- name: "quickbooks"
url: "/qb'"
schedule: "0 * * * *"
- name: "Shopify-Completed"
url: "/shopify-completed"
schedule: "0 * * * *"
- name: "License-Orders"
url: "/getLicenseOrders"
schedule: "0 * * * *"
- name: "Tee-Orders"
url: "/getTeesOrders"
schedule: "0 * * * *"
- name: "Engraved-Orders"
url: "/getEngravedOrders"
schedule: "0 * * * *"
- name: "Engraved-Mexico-Orders"
url: "/getMexicoEngravedOrders"
schedule: "0 * * * *"
- name: "Shopify-All-Orders"
url: "/pull-shopify-orders"
schedule: "*/10 * * * *"

这些都是我项目中经过验证的路线。 例如,当我手动转到 example.com//pull-shopify-orders 时,它会执行。 但是,当它在 cron 中时,它不会发射。 知道为什么吗?

cron.yaml仅支持工作线程环境:

您可以在源包中名为 cron.yaml 的文件中定义定期任务,以定期自动将作业添加到工作线程环境的队列中。

对于 Web 环境,您必须使用.ebextentions"手动"设置 cron 。最近的 AWS 博客文章对此进行了演示:

  • 如何在 Elastic Beanstalk 环境中的 Amazon EC2 实例上创建 cron 作业?

这涉及使用定义的文件和命令部分创建cron-linux.config(示例名称(文件。

最新更新