Skip to content

Commit

Permalink
修改reload在开启opcache后不起作用的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
titrxw committed Jul 17, 2019
1 parent bd29388 commit b9cd40f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Src/Core/Listener/WorkerStartListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

class WorkerStartListener implements ListenerInterface {
public function run(...$params) {
if (ini_get('opcache.enable') || ini_get('opcache.enable_cli')) {
opcache_reset();
}

\isetProcessTitle( 'w7swoole ' . App::$server->type . (App::$server->server->taskworker ? ' task' : '') . ' worker process');

//设置安全限制目录
Expand Down
4 changes: 1 addition & 3 deletions Src/Core/Process/ReloadProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ public function run(Process $process) {
if ($startReload) {
$server->isRun();
$server->getServer()->reload();
if (ini_get('opcache.enable') || ini_get('opcache.enable_cli')) {
opcache_reset();
}

if (!$this->debug) {
ioutputer()->writeln("Reloaded in " . date('m-d H:i:s') . "...");
}
Expand Down

0 comments on commit b9cd40f

Please sign in to comment.