la9998372
V2EX  ›  问与答

Github Actions 定时设置问题

  •  
  •   la9998372 · Mar 16, 2023 · 969 views
    This topic created in 1206 days ago, the information mentioned may be changed or developed.
    on:
      workflow_dispatch:
      schedule:
        - cron: '30,59 0,15 * * *'
    

    如此设置的情况下,为什么一天只执行三次啊?

    本意是北京时间 8 点 30/59 分和 23 点 30/59 分,每天执行四次。但是实际情况是,大概是上午 9 点 40-55 左右执行一次,晚上可以执行两次,请问这是啥情况?

    AoEiuV020CN
        1
    AoEiuV020CN  
       Mar 16, 2023
    一方面注意时区,
    一方面这个 cron 误差巨大,一两个小时都正常,
    但我没见过少执行了的情况,会不会算上误差两次挤到一起就丢了一次,
    la9998372
        2
    la9998372  
    OP
       Mar 16, 2023
    @AoEiuV020CN
    cron 可以写两行吗?

    ```
    on:
    workflow_dispatch:
    schedule:
    - cron: '30 0 * * *'
    - cron: '59 15 * * *'
    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2629 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:30 · PVG 18:30 · LAX 03:30 · JFK 06:30
    ♥ Do have faith in what you're doing.