多个yaml cron计划在Azure DevOps管道中不起作用

发布于 2025-02-07 06:02:31 字数 1056 浏览 2 评论 0原文

我有2个Cron时间表在Azure Devops中定义,但并非都受到尊重。

trigger: none

schedules:
  - cron: '0 */1 * * Mon-Sat'
    always: true
    displayName: Run Every hour Monday to Saturday
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

  - cron: '0 0-11,16-23 * * Tue-Wed'
    always: true
    displayName: Run Every hour on Tuesday and Wednesday except 12, 13, 14 and 15
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

这些是:

  • 每小时每小时每小时每小时
  • 每小时每小时在0-11至16-23之间每小时运行(因此不要在11-16之间进行)。

但是,它忽略了第二个条件....

”“在此处输入图像说明”

https://i.sstatic.net/opdun.png“ alt =“在此处输入图像说明”>

我该如何达到此要求?

I have 2 cron schedules defined in Azure Devops but they are not both being respected.

trigger: none

schedules:
  - cron: '0 */1 * * Mon-Sat'
    always: true
    displayName: Run Every hour Monday to Saturday
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

  - cron: '0 0-11,16-23 * * Tue-Wed'
    always: true
    displayName: Run Every hour on Tuesday and Wednesday except 12, 13, 14 and 15
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

These are saying:

  • Run every hour Monday to Saturday
  • Run every hour Tuesday to Wednesday between 0-11 and 16-23 (Therefore don't run between 11-16).

However it is ignoring the second condition....

enter image description here

enter image description here

How can I achieve this requirement?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烙印 2025-02-14 06:02:31

微软对限制不是很具体,但请记住这一点。

限制计划运行的数量:
您可以安排运行管道的频率有一定的限制。这些限制已建立,以防止滥用Azure Pipelines资源,尤其是Microsoft托管的代理。该限制是每周每条管道的1000次运行。 ~

但是,我认为您只是有一个Cron冲突。
尝试以下操作:

schedules:
  - cron: '0 */1 * * Mon'
    always: true
    displayName: Run Every hour Monday
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

  - cron: '0 0-11,16-23 * * Tue-Wed'
    always: true
    displayName: Run Every hour on Tuesday and Wednesday except 12, 13, 14 and 15
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

  - cron: '0 */1 * * Thu-Sat'
    always: true
    displayName: Run Every hour Thursday to Saturday
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

Microsoft isn't very specific about limitations but keep this in mind.

Limits on the number of scheduled runs:
There are certain limits on how often you can schedule a pipeline to run. These limits have been put in place to prevent misuse of Azure Pipelines resources, particularly the Microsoft-hosted agents. This limit is around 1000 runs per pipeline per week. ~ Microsoft Documentation

However I think you just have a cron conflict.
Try this:

schedules:
  - cron: '0 */1 * * Mon'
    always: true
    displayName: Run Every hour Monday
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

  - cron: '0 0-11,16-23 * * Tue-Wed'
    always: true
    displayName: Run Every hour on Tuesday and Wednesday except 12, 13, 14 and 15
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive

  - cron: '0 */1 * * Thu-Sat'
    always: true
    displayName: Run Every hour Thursday to Saturday
    branches:
      include:
        - beverly-hills-ops/matt.oconnor/904176-reactive
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文