Hot code reloading not working #4183
-
Hello, We are using 4.5.9 of Swoole. We tried to implement hot reloading using the instructions provided in: For testing we created a single file server.php that has following code in it:
we are able to run the server and verify as follows:
To get the PID we use
and then we change the response from
Expected: hot code reload. server should return new response. Observed:
and server still returns the old response:
can anyone help us? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
- $http->on('BeforeReload', function($serv, $workerId) {
+ $http->on('BeforeReload', function($serv) {
var_dump(get_included_files());
});
- $http->on('AfterReload', function($serv, $workerId) {
+ $http->on('AfterReload', function($serv) {
var_dump(get_included_files());
});
The Use the |
Beta Was this translation helpful? Give feedback.
The
reload
operation can only reload PHP files that were loaded after the worker process was started.Use the
get_included_files
function to list which PHP files were loaded before WorkerStart. PHP files in this list cannot be reloaded, even after a reload operation, and need to be shut down and restarted to take effect.