| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- //return [
- // 'connector' => 'Redis', // Redis 驱动
- // 'expire' => 60, // 任务的过期时间,默认为60秒; 若要禁用,则设置为 null
- // 'default' => 'default', // 默认的队列名称
- // 'host' => '127.0.0.1', // redis 主机ip
- // 'port' => 6379, // redis 端口
- // 'password' => '', // redis 密码
- // 'select' => 15, // 使用哪一个 db,默认为 db0
- // 'timeout' => 0, // redis连接的超时时间
- // 'persistent' => false,
- //];
- // config/queue.php
- return [
- 'connector' => 'Redis', // Redis 驱动
- 'expire' => 600, // 任务的过期时间
- 'default' => 'salary_calculation', // 默认队列名称改为工资计算
- 'host' => '127.0.0.1', // redis 主机ip
- 'port' => 6379, // redis 端口
- 'password' => '123456', // redis 密码
- 'select' => 15, // 使用哪一个 db
- 'timeout' => 0, // redis连接的超时时间
- 'persistent' => false,
- // 自定义配置 - 多队列支持
- 'queues' => [
- // 工资计算队列(默认队列,保持原有逻辑)
- 'salary_calculation' => [
- 'expire' => 600, // 10分钟超时
- 'delay' => 0,
- 'retry' => 2,
- ],
- // 成本计算队列(新增队列)
- 'cost_calculation' => [
- 'expire' => 1800, // 半小时超时
- 'delay' => 0, // 立即执行
- 'retry' => 3, // 重试次数
- ],
- // 低优先级队列
- 'low_priority' => [
- 'expire' => 3600, // 1小时超时
- 'delay' => 300, // 延迟5分钟执行
- 'retry' => 1,
- ]
- ],
- ];
|