- 增加 Agent Run MVP-0,包括 RunDispatcher 和 AgentRunJob - 优化队列配置,支持 Redis 队列驱动,添加 Horizon 容器 - 更新 Docker 配置,细化角色分工,新增 Horizon 配置 - 增加测试任务 `TestJob`,扩展队列使用示例 - 更新 OpenAPI 规范,添加 Agent Run 相关接口及示例 - 编写文档,详细描述 Agent Run 流程与 MVP-0 功能 - 优化相关服务与文档,支持队列与异步运行
187 lines
6.1 KiB
PHP
187 lines
6.1 KiB
PHP
<?php
|
|
|
|
return [
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Horizon Domain
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This is the subdomain where Horizon will be accessible from. If this
|
|
| setting is null, Horizon will reside under the same domain as the
|
|
| application. Otherwise, this value will serve as the subdomain.
|
|
|
|
|
*/
|
|
|
|
'domain' => env('HORIZON_DOMAIN'),
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Horizon Path
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This is the URI path where Horizon will be accessible from. Feel free
|
|
| to change this path to anything you like. Note that the URI will not
|
|
| affect the paths of its internal API that aren't exposed to users.
|
|
|
|
|
*/
|
|
|
|
'path' => env('HORIZON_PATH', 'horizon'),
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Horizon Redis Connection
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This is the name of the Redis connection where Horizon will store the
|
|
| meta information required for it to function. It includes the list
|
|
| of supervisors, failed and completed jobs, job metrics, and more.
|
|
|
|
|
*/
|
|
|
|
'use' => 'default',
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Horizon Redis Prefix
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This prefix will be used when storing all Horizon data in Redis. You
|
|
| may modify the prefix when you are running multiple installations
|
|
| of Horizon on the same server so that they don't have problems.
|
|
|
|
|
*/
|
|
|
|
'prefix' => env('HORIZON_PREFIX', 'horizon:{single}'),
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Horizon Route Middleware
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| These middleware will be assigned to every Horizon route, giving you the
|
|
| chance to add your own middleware to this list or change any of the
|
|
| existing middleware. Or, you can simply stick with this default list.
|
|
|
|
|
*/
|
|
|
|
'middleware' => ['web'],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Queue Wait Time Thresholds
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This option allows you to configure when Horizon will notify you the
|
|
| queue is waiting too long to process jobs. Each connection / queue
|
|
| combination may have its own, unique threshold (in seconds).
|
|
|
|
|
*/
|
|
|
|
'waits' => [
|
|
'redis:default' => env('HORIZON_WAIT_TIME', 60),
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Job Trimming Times
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here you can configure for how long (in minutes) you desire Horizon to
|
|
| persist the recent and failed jobs. Typically, recent jobs are kept
|
|
| for one hour while all failed jobs are stored for an entire week.
|
|
|
|
|
*/
|
|
|
|
'trim' => [
|
|
'recent' => 60,
|
|
'pending' => 60,
|
|
'completed' => 60,
|
|
'recent_failed' => 10080,
|
|
'failed' => 10080,
|
|
'monitored' => 1440,
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Silenced Jobs
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Silent jobs are not displayed in the Horizon UI. This allows you to
|
|
| fully avoid showing them or incrementing the failed jobs count
|
|
| or displaying them on the monitoring charts. They're silenced.
|
|
|
|
|
*/
|
|
|
|
'silenced' => [
|
|
// App\Jobs\QuietJob::class,
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Fast Termination
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| When this option is enabled, Horizon's "terminate" command will not
|
|
| wait on all of the workers to terminate unless the --wait option
|
|
| is provided. Fast termination can shorten deployment delay by
|
|
| allowing a new instance of Horizon to start immediately.
|
|
|
|
|
*/
|
|
|
|
'fast_termination' => false,
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Memory Limit (MB)
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This value describes the maximum amount of memory the Horizon worker
|
|
| may consume before it is terminated and restarted. You should set
|
|
| this value according to the resources available to your server.
|
|
|
|
|
*/
|
|
|
|
'memory_limit' => env('HORIZON_MEMORY_LIMIT', 128),
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Queue Worker Configuration
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here you may define the queue worker settings used by your application
|
|
| in all environments. These supervisors and settings handle all your
|
|
| queued jobs and will be provisioned by Horizon during deployment.
|
|
|
|
|
*/
|
|
|
|
'environments' => [
|
|
'production' => [
|
|
'supervisor-default' => [
|
|
'connection' => 'redis',
|
|
'queue' => ['default'],
|
|
'balance' => 'auto',
|
|
'maxProcesses' => 10,
|
|
'maxTime' => 60,
|
|
'maxJobs' => 1000,
|
|
'memory' => 256,
|
|
'tries' => 3,
|
|
],
|
|
],
|
|
|
|
'local' => [
|
|
'supervisor-default' => [
|
|
'connection' => 'redis',
|
|
'queue' => ['default'],
|
|
'balance' => 'simple',
|
|
'maxProcesses' => env('HORIZON_PROCESSES', 3),
|
|
'maxTime' => 60,
|
|
'maxJobs' => 500,
|
|
'memory' => 256,
|
|
'tries' => 3,
|
|
],
|
|
],
|
|
],
|
|
|
|
];
|