Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 771 Bytes

6.0-CRON.md

File metadata and controls

27 lines (21 loc) · 771 Bytes

计划任务配置(Cron Configuration)

注意计划任务命名是"cron_"开头 这一节我们新增一个监听队列"cron_demo",测试计划任务

1步 配置新的计划任务"cron_test"

在项目根目录下"config/crons.config.yml"中

# 计划任务列表
cron_test: # 测试cron
  class: "\\Zwei\\RabbitMqEvent\\Tests\\Demo\\Cron\\DemoCron" # 调用类
  method: "testFunc" # 调用方法

2步 运行普通队列

运行计划任务"cron_test":vendor/bin/zwei-rabbitmq-event-cron cron_demo

vendor/bin/zwei-rabbitmq-event-cron 计划任务名

windows: vendor\bin\zwei-rabbitmq-event-cron cron_demo
linux: vendor/bin/zwei-rabbitmq-event-cron cron_demo