Skip to content

Commit 4593cec

Browse files
authored
Allow configuring max workers, requests via config (#1028)
1 parent a35139e commit 4593cec

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Commands/StartCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ protected function startSwooleServer()
6767
return $this->call('octane:swoole', [
6868
'--host' => $this->getHost(),
6969
'--port' => $this->getPort(),
70-
'--workers' => $this->option('workers'),
71-
'--task-workers' => $this->option('task-workers'),
72-
'--max-requests' => $this->option('max-requests'),
70+
'--workers' => $this->option('workers') ?: config('octane.workers', 'auto'),
71+
'--task-workers' => $this->option('task-workers') ?: config('octane.task_workers', 'auto'),
72+
'--max-requests' => $this->option('max-requests') ?: config('octane.max_requests', 500),
7373
'--watch' => $this->option('watch'),
7474
'--poll' => $this->option('poll'),
7575
]);
@@ -87,8 +87,8 @@ protected function startRoadRunnerServer()
8787
'--port' => $this->getPort(),
8888
'--rpc-host' => $this->option('rpc-host'),
8989
'--rpc-port' => $this->option('rpc-port'),
90-
'--workers' => $this->option('workers'),
91-
'--max-requests' => $this->option('max-requests'),
90+
'--workers' => $this->option('workers') ?: config('octane.workers', 'auto'),
91+
'--max-requests' => $this->option('max-requests') ?: config('octane.max_requests', 500),
9292
'--rr-config' => $this->option('rr-config'),
9393
'--watch' => $this->option('watch'),
9494
'--poll' => $this->option('poll'),
@@ -107,8 +107,8 @@ protected function startFrankenPhpServer()
107107
'--host' => $this->getHost(),
108108
'--port' => $this->getPort(),
109109
'--admin-port' => $this->option('admin-port'),
110-
'--workers' => $this->option('workers'),
111-
'--max-requests' => $this->option('max-requests'),
110+
'--workers' => $this->option('workers') ?: config('octane.workers', 'auto'),
111+
'--max-requests' => $this->option('max-requests') ?: config('octane.max_requests', 500),
112112
'--caddyfile' => $this->option('caddyfile'),
113113
'--https' => $this->option('https'),
114114
'--http-redirect' => $this->option('http-redirect'),

0 commit comments

Comments
 (0)