3👍
✅
I wanted to circle back and explain what happened here. Global variables are, in fact, not “refreshed” between requests to the same service in uWSGI. Thus, if you create a module level variable, it will carry state between multiple requests. This, obviously, was not what I intended; so I ended up passing a caching object around between the different calls into XMLGenerator
. It caused the API to be quite ugly, but avoided the issue with module-level variables.
1👍
If you are doing this with multiple workers than you probably want to use uwsig’s CachingFramework:
http://projects.unbit.it/uwsgi/wiki/CachingFramework
Otherwise I believe _cache can be different across the workers.
Also, you could test with uwsgi –processes 1 to see if the problem goes away.
- [Django]-How should error corresponding to an AJAX request be passed to and handled at the client-side?
- [Django]-Django filename from database with non-ascii characters
- [Django]-Django/MongoDB tutorials for beginner
- [Django]-Django trigger post_save on update()
- [Django]-Why is Idle Python Thread Consuming upto 90% of CPU?
Source:stackexchange.com