stavinsky / supervisord-touch-reload

Very basic script used to add "touch-reload" like in uwsgi to supervisord
MIT License
8 stars 0 forks source link

Reload on multiple files #1

Open edwardmp opened 8 years ago

edwardmp commented 8 years ago

Hey, I found your solution on http://stackoverflow.com/questions/20227965/is-there-a-way-to-automatically-reload-supervisor-processes/39110886?noredirect=1#comment66649015_39110886

I was wondering, if my python application consists of multiple files can I just use the touch_reload script on all single files or is there an easier solution?

stavinsky commented 8 years ago

Hello. Can you give me more information about you task?

hackel commented 7 years ago

The use-case is to restart a long-running process (in my case a queue worker) whenever the code itself has changed.

It appears that switching to os.path.exists in https://github.com/stavinsky/supervisord-touch-reload/blob/master/touch_reload/__init__.py#L96 may be enough to get this working when --file specifies a directory or symlink instead of a regular file.

Ideally, advanced globbing would be implemented, so you could do e.g. --file='/some/path/*/.php' or something like that, perhaps with an exclude list as well.

stavinsky commented 7 years ago

Ok. I didn't think in this way. I will try to find time and add behaviour.