-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.4.0+ breaks one-time configuration (evidenced in validates_timeliness) #37
Comments
Yes, unfortunately the threadsafe switching forced a compromise. In v0.4.0 the format set was empty in each new thread, which forced you to use In v0.4.2 I fixed it so that in new threads the format set would initially be the main thread's format set, but required the use of a new config setting i.e. So I added a config option that can put the onus on the developer to set it in a threadsafe way i.e. before spawning new threads, or your case during Rails boot. But as you've pointed out for existing use in Because Overall I'm not really happy with the gem's management of format sets and I'm looking into changing it for a v1.0 release. |
@timdiggins I've pushed a change to ValidatesTimeliness on 4-0-stable branch if you want to try out my solution. |
see latest ValidatesTimeliness which I think should fix your issue. |
hi @adzap I've tried out the change but my test is failing. So have continued discussion in adzap/validates_timeliness#187 |
PS -- sorry it took sooooo long for me to get back to you on this! |
v0.4.0 which brought in thread safety (#21, #23) seems to have broken configurability of some servers - I'm working with puma, but I think others may exhibit this functionality.
I think this is because the changes in #23 require each new thread to be configured, whereas the rails initializers are assuming a copy-on-write approach.
Here's a spec to demonstrate (I have higher level (system) specs that demonstrate the real world problem, but they are bound into the codebase):
fyi, config/initializers/validates_timeliness.rb:
The text was updated successfully, but these errors were encountered: