-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Mention that Timeliness is not thread safe. #21
Comments
Ah yes fair enough. The gem is poorly designed for this usage. Though I am keen to resolve this. It shouldn't be too hard. |
I'll take a shot at making it threadsafe on Monday. I was thinking to store the class variables from Timeliness::Definitions in Thread.current[]. Is that the same approach you were considering?
|
Any news? Thanks! |
Hi @dgilperez. I thought I had already opened a PR, but it doesn't seem that way. Here's the branch we use in production with sidekiq threads: https://github.com/andruby/timeliness/tree/multithread. I'll try to open a PR when I have time. |
Reproducable with:
This will raise a
NoMethodError: undefined method 'to_date' for nil:NilClass
because it parsed one of the dates in the wrong US/EU format.I suggest we at least mention this in the README. We bumped into this using Timeliness inside sidekiq workers.
The text was updated successfully, but these errors were encountered: