It is obvious that if the application is running I would like to work without 
interruption.
At the same time I want to make changes to it.
So I type inside start.py (my uWSGI app):

uwsgi.register_signal(1, "workers", uwsgi.reload)
uwsgi.add_file_monitor(1, './start.py')

That way, if I make changes uWSGI reload the application.

However, if you commit a typo before the above lines of code, of course, the 
application will be reloaded, I see traceback in the logs, but after fixing the 
error no longer reload again.
Although correct the error, I get HTTP500. Of course, if I find the PID of the 
application and send HUP is ok.
That's why I register a signal in the first lines of code.
Despite this "IndentationError: unexpected indent" and I have to restart the 
application manually :/

At the beginning I thought it would be good to uWSGI periodically try to run 
the application
when "unable to load the app mountpoint =".

But if nothing changes in the code, it is unlikely that the error will 
disappear itself. Unless cause of the error is lack of some module that was 
installed during, or other error code independent.

It would be nice to be able to set the interval at which uWSGI will be renewed 
attempt to run the application.

Later I thought that would be good to be able to register the signals already 
from the configuration.

ini eg:
[uwsgi]
register_signal = 1;workers;uwsgi.reload
add_file_monitor = 1;start.py

or something similar...

Enough to me:
reload_on_change = start.py[;...]




-- 
Łukasz Wróblewski
http://www.nri.pl/ - Nowoczesne Rozwiązania Internetowe
http://www.hostowisko.pl/ - Profesjonalny i tani hosting
http://www.katalog-polskich-firm.pl/ - Najlepszy darmowy katalog firm
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to