Closed lud closed 2 years ago
I actually have no experience with builds. What about config/runtime.exs
?
That won't work because your have the following code directly in the module body:
@custom_data_dir Application.get_env(:tz, :data_dir)
So it is evaluated when the library is compiled, not when runtime is launched.
What about changing that line to
defp custom_data_dir() do
Application.get_env(:tz, :data_dir)
end
Yep sure, that would work.
Can you try it out and check if your deployments work with different config? And send a PR? Or are you certain this will just do?
Sorry we switched to tzdata when we faced that problem, I have currently no app using tz.
This has been added in version 0.21.1.
Note that tzdata has bugs, sometimes may return wrong times or raise errors. That's why I created this library in the first place, I would never have spent months writing it otherwise.
Only tz
and time_zone_info
output correct times.
Hi,
Yes I know, that is why we used tz and I raised this issue but we needed to configure the custom dir at runtime to work well with our docker deployment. That was for CRON-like jobs, just dealing with 2022+ dates.
I'll try again tz on a future iteration but I honestly don't know when I will work on this project again.
Currently it is set at compile time.
Would that be ok for the value to be fetched at runtime, so it can be set as an environment variable in production environments or docker containers?
Thank you