> Hey,
>
> Would it be possible to make uWSGI generate a RUNTIME_ID environmental
> variable (or WSGI variable) which is unique to that runtime, and stays the
> same after harikari and/or respawning of the Python processes.
>
> Typical use case:
>
> Being able to have a different caching name scope, everytime you do a
> uWSGI
> restart (for example, when something in the app changes). If you generate
> it
> inside Python, you end up with a new one per Python worker :(
>
>

The pid of the master process is unique for all the app lifecycle (the
reload of the master is a simple execve() in the same process)

os.environ['RUNTIME_ID'] = uwsgi.masterpid()

If you want to maintain this RUNTIME_ID even after master crash/stop you
should save the id in a file and read it on server start (before fork())


If you are talking about the uWSGI caching subsystem remember that you can
make it persistent with --cache-store <filename>


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to