Hi,
I'm trying to use the add_file_monitor function to detect a change in an
application config file. I put the following in my application:
def init():
uwsgi.register_signal(99, 'workers', change_response)
uwsgi.add_file_monitor(99, '/Users/berndtj/Dev/uwsgi/message.txt')
If I wrap the those calls in a function called from uwsgi.post_fork_hook, all
workers register the signal, and all workers (and more receive the signal:
Tue May 17 08:03:41 2011 - master sent signal 1 to worker 1
Tue May 17 08:03:41 2011 - master sent signal 1 to worker 4
Tue May 17 08:03:41 2011 - master sent signal 1 to worker 3
Tue May 17 08:03:41 2011 - master sent signal 1 to worker 2
Tue May 17 08:03:42 2011 - master sent signal 1 to worker 1
If I register the signals globally without the post_fork_hook, only some of the
workers get the signal.
In all situations though, the signal is only sent the first time the file is
changed. Subsequent changes do not trigger the signal. This seems like a bug,
as the signal should fire on every change according to the docs.
Perhaps this feature isn't fully implemented yet, or I'm doing it wrong.
uwsgi-version: tip (as of last night)
Thanks in advance!
Berndt
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi