工单分类

This commit is contained in:
2025-07-04 13:45:50 +08:00
parent 2be25889ea
commit 3be2ae983c
28 changed files with 900 additions and 8 deletions
+4
View File
@@ -0,0 +1,4 @@
<?php
return [
'enable' => true,
];
@@ -0,0 +1,7 @@
<?php
use Webman\RedisQueue\Command\MakeConsumerCommand;
return [
MakeConsumerCommand::class
];
+32
View File
@@ -0,0 +1,32 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'default' => [
'handlers' => [
[
'class' => Monolog\Handler\RotatingFileHandler::class,
'constructor' => [
runtime_path() . '/logs/redis-queue/queue.log',
7, //$maxFiles
Monolog\Logger::DEBUG,
],
'formatter' => [
'class' => Monolog\Formatter\LineFormatter::class,
'constructor' => [null, 'Y-m-d H:i:s', true],
],
]
],
]
];
@@ -0,0 +1,12 @@
<?php
return [
'consumer' => [
'handler' => Webman\RedisQueue\Process\Consumer::class,
'count' => getenv('REDIS_QUEUE_PROCESS_COUNT'), // 可以设置多进程同时消费
'constructor' => [
// 消费者类目录
// 'consumer_dir' => app_path() . '/queue/redis'
'consumer_dir' => app_path() . getenv('REDIS_QUEUE_CONSUMER_DIR')
]
]
];
@@ -0,0 +1,22 @@
<?php
return [
'default' => [
// 'host' => 'redis://127.0.0.1:6379',
'host' => getenv('REDIS_QUEUE_HOST'),
'options' => [
'auth' => getenv('REDIS_QUEUE_AUTH'), // 密码,字符串类型,可选参数
'db' => getenv('REDIS_QUEUE_DB'), // 数据库
'prefix' => getenv('REDIS_QUEUE_PREFIX'), // key 前缀
'max_attempts' => getenv('REDIS_QUEUE_MAX_ATTEMPTS'), // 消费失败后,重试次数
'retry_seconds' => getenv('REDIS_QUEUE_RETRY_SECONDS'), // 重试间隔,单位秒
],
// Connection pool, supports only Swoole or Swow drivers.
'pool' => [
'max_connections' => 5,
'min_connections' => 1,
'wait_timeout' => 3,
'idle_timeout' => 60,
'heartbeat_interval' => 50,
]
],
];