swoole / docker-swoole

🏄 Official Docker Image of Swoole
https://hub.docker.com/r/phpswoole/swoole
Apache License 2.0
526 stars 112 forks source link

AUTORELOAD_ANY_FILES #15

Closed galliroberto closed 4 years ago

galliroberto commented 4 years ago

Good morning, I have setted AUTORELOAD_ANY_FILES=1 but hot reload not work.

I use symfony with https://github.com/k911/swoole-bundle i have installed inotify, but when i change php file, the change is not reflected.

deminy commented 4 years ago

I don't have much background information for your case, but my guess is that it could be one of the two reasons:

  1. Missing option "autorestart = true" in the Supervisor configuration file.

If your Supervisor configuration file look like this,

[supervisord]
user = root

[program:symfony]
command = ./bin/console swoole:server:run
user = root
autostart = true
stdout_logfile=/proc/self/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/proc/self/fd/1
stderr_logfile_maxbytes=0

please consider to change it to:

[supervisord]
user = root

[program:symfony]
command = ./bin/console swoole:server:run
user = root
autostart = true
autorestart = true
stdout_logfile=/proc/self/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/proc/self/fd/1
stderr_logfile_maxbytes=0
  1. There could be too many files under your working directory, which excceeds the limit of the autoloading program inotify. If that's the case, please follow my answer here to increase the limit.