queue.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: yunwuxin <448901948@qq.com>
  10. // +----------------------------------------------------------------------
  11. return [
  12. 'default' => 'database',
  13. 'connections' => [
  14. 'sync' => [
  15. 'type' => 'sync',
  16. ],
  17. 'database' => [
  18. 'type' => 'database',
  19. 'queue' => 'default',
  20. 'table' => 'jobs',
  21. 'connection' => null,
  22. ],
  23. 'redis' => [
  24. // 驱动方式
  25. 'type' => 'redis',
  26. 'queue' => 'default',
  27. // 服务器地址
  28. 'host' => env('redis.redis_hostname', '127.0.0.1'),
  29. // 端口
  30. 'port' => env('redis.port', '6379'),
  31. // 密码
  32. 'password' => env('redis.redis_password', ''),
  33. // 缓存有效期 0表示永久缓存
  34. 'expire' => 0 ,
  35. // 缓存前缀
  36. 'prefix' => 'QUERY',
  37. // 缓存标签前缀
  38. 'tag_prefix' => 'QUERY:',
  39. // 数据库 0号数据库
  40. 'select' => env('redis.select', 0),
  41. // 服务端主动关闭
  42. 'timeout' => 0,
  43. 'persistent' => false,
  44. ],
  45. ],
  46. 'failed' => [
  47. 'type' => 'none',// none 不记录失败任务 database 将失败任务迁移到失败任务表
  48. 'table' => 'jobs_failed',
  49. ],
  50. ];