Files
CKB-DataSourceCenter/config/process.php
乘风 db3b80d3ff 增强 MongoDB 集成及用户管理功能
更新 composer.json 文件,添加新的依赖项:vlucas/phpdotenv、predis/predis、dragonmantank/cron-expression、php-amqplib/php-amqplib 以及 ramsey/uuid。
在 IndexController 中添加 MongoDB 连接测试接口。
在 UserController 中实现用户管理接口,用于创建、更新、删除和搜索用户。
在 database.php 中配置 MongoDB 连接设置。
更新路由,以包含新的与用户相关的 API 接口。
增强用户操作中的错误处理和日志记录功能。
在 process.php 中引入数据同步和工作进程配置。
2026-01-05 10:46:44 +08:00

84 lines
2.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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
*/
use support\Log;
use support\Request;
use app\process\Http;
global $argv;
return [
'webman' => [
'handler' => Http::class,
'listen' => 'http://0.0.0.0:8787',
'count' => cpu_count() * 4,
'user' => '',
'group' => '',
'reusePort' => false,
'eventLoop' => '',
'context' => [],
'constructor' => [
'requestClass' => Request::class,
'logger' => Log::channel('default'),
'appPath' => app_path(),
'publicPath' => public_path()
]
],
// File update detection and automatic reload
'monitor' => [
'handler' => app\process\Monitor::class,
'reloadable' => false,
'constructor' => [
// Monitor these directories
'monitorDir' => array_merge([
app_path(),
config_path(),
base_path() . '/process',
base_path() . '/support',
base_path() . '/resource',
base_path() . '/.env',
], glob(base_path() . '/plugin/*/app'), glob(base_path() . '/plugin/*/config'), glob(base_path() . '/plugin/*/api')),
// Files with these suffixes will be monitored
'monitorExtensions' => [
'php', 'html', 'htm', 'env'
],
'options' => [
'enable_file_monitor' => !in_array('-d', $argv) && DIRECTORY_SEPARATOR === '/',
'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
]
]
],
// 数据采集任务调度器(从 config/data_collection_tasks.php 读取所有采集任务配置)
'data_sync_scheduler' => [
'handler' => app\process\DataSyncScheduler::class,
'count' => 10, // Worker 进程数量(可根据任务数量调整)
'reloadable' => false,
],
// 数据同步 Worker消费 RabbitMQ 消息队列)
// 处理从采集任务推送过来的数据,写入目标数据库
'data_sync_worker' => [
'handler' => app\process\DataSyncWorker::class,
'count' => 20, // Worker 进程数量(可根据消息量调整)
'reloadable' => false,
],
// 标签计算 Worker消费 RabbitMQ 消息队列)
// 根据用户数据计算标签值
'tag_calculation_worker' => [
'handler' => app\process\TagCalculationWorker::class,
'count' => 2, // Worker 进程数量(可根据消息量调整)
'reloadable' => false,
],
];