Worker::stopAll()后代码无法更新问题

sun2920989

经测试,在on回调中直接require或include的文件,可以在Worker::stopAll()后更新
但是在on回调引入的文件内再次require或include一个文件的话,这个文件的内容不会被Worker::stopAll()更新
请问是设计如此还是存在BUG,示例代码

$worker->onClose = function($connection){
    echo '我都退出了你还不加载新代码!';
    Worker::stopAll();
};
$worker->onConnect = function($connection){
    // 设置连接的onMessage回调
    $connection->onMessage = function($connection, $data){
        require('./test.php');
        $connection->close();
    };
};
Worker::runAll();

如上面代码所示,test.php中的文件会随Worker::stopAll();而更新,但是test.php中有一句 require('./test1.php');
此时test1中的代码没有进行更新

2650 3 0
3个回答

sun2920989

使用版本3.3.3

  • 暂无评论
sun2920989

经测试基本确定是开启了opcache导致的,请版主删除该问答

  • 暂无评论
walkor

ok,opcache导致

  • 暂无评论
年代过于久远,无法发表回答
🔝