mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
9128ba5cd4
In #25880 we tried to cache localtime to fix the performance regression but that proved to be difficult due to the fact that localtime/getlocal can take a utc_offset argument. We tried caching based on the argument but since the argument can be nil sometimes that meant that if the TZ environment variable changed then the cached value for nil became invalid. By moving the caching to DateAndTime#compatibility we don't have to worry about arguments since it doesn't take any. There is a possible edge condition where preserve_timezone is set to false and the system timezone changes then it could result in a cached value being incorrect but the only way to fix this would be to remove all caching and live with the performance issue. |
||
---|---|---|
.. | ||
active_support | ||
active_support.rb |