Closed tbuehlmann closed 10 years ago
Ok. RequestStore simply ensures to clear out the Thread variable on each request. Simple and clear. Nice.
Yes, we should use it to avoid concurrency problems.
Please send a pull request that solves this.
Thanks for pointing that one out.
We had this issue with unicorn, as well, and I hacked it badly to work. Pretty please: PR :) :+1:
I will close this one as the PR is open: https://github.com/magiclabs/alchemy_cms/pull/625
So, we had problems (which are too heavy to describe in length) with Language settings and figured out that it likely had to do with the threaded web application server (Puma) we are using. The actual reason for this was the use of thread local variables, as in here:
After replacing the Thread locals with RequestStore (https://github.com/steveklabnik/request_store) variables, the problems disappeared.
I highly recommend against using Thread locals in the way it is done right now and suggest using something like RequestStore. If there's interest I'd write down a PR for it.