Cron Trigger 根據指定的週期來調用 Function

如何建立 Cron Trigger

假設想要每分鐘去觸發指定 Function,您可以使用* * * * * Crontab 規範來建立 Cron Trigger (如想瞭解更多有關於 Crontab 規範的設定方式,請參考文件)。

  syntixi crontrigger create --name hello --function hello --cron "* * * * *"
  

暫停 Cron Trigger

要暫停一個 Cron Trigger 需要在建立或更新 Cron Trigger時加入--suspend參數。現在我們暫停剛剛建立的 Cron Trigger

  syntixi crontrigger update --name hello --suspend
  

要解除暫停 Cron Trigger,需要將 --suspend 設定為 false

  syntixi crontrigger update --name hello --suspend=false
  
Was this page helpful?