Perfect. This is exactly what i wanted. Thank you Roberto.
On Wed, Oct 13, 2010 at 8:11 AM, Roberto De Ioris <[email protected]> wrote: > > Hello, > > > > I am using uwsgi with a django application behind nginx. I 'd like to > > introduce some initialization logic just after workers spawning but > before > > actual django app's loading. Eg. i 'd like to set some env variables > which > > names contains the workers' pid or even pre-initialize each > > worker/django's > > logging facilities. I have read about 'uwsgi.workers()' but their pids > are > > (of course) 0 when -w module is loaded while i can't find any hook > between > > worker spawning and app's loading. Any ideas? Is there any hook for that? > > > > Thank you, > > George Kollias. > > Hi George, apply the attached patch and simply > define a uwsgi.post_fork_hook callable: > > def hello(): > print "i am the new worker" > > uwsgi.post_fork_hook = hello > > > -- > Roberto De Ioris > http://unbit.it > _______________________________________________ > uWSGI mailing list > [email protected] > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi > >
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
