Skip to content

Commit

Permalink
Moved opcache clearing to before bootWorker (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
LauJosefsen authored Jun 27, 2022
1 parent c412ee9 commit a746fd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Swoole/Handlers/OnWorkerStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ public function __construct(
*/
public function __invoke($server, int $workerId)
{
$this->clearOpcodeCache();

$this->workerState->server = $server;
$this->workerState->workerId = $workerId;
$this->workerState->workerPid = posix_getpid();
$this->workerState->worker = $this->bootWorker($server);

$this->dispatchServerTickTaskEverySecond($server);
$this->streamRequestsToConsole($server);
$this->clearOpcodeCache();

if ($this->shouldSetProcessName) {
$isTaskWorker = $workerId >= $server->setting['worker_num'];
Expand Down

0 comments on commit a746fd5

Please sign in to comment.