lau/tzdata

[proposal] Split off updater

Closed this issue · 3 comments

The discussion about tzdata's unexpected update behaviour came up on Slack again (https://elixir-lang.slack.com/archives/C0AB4A879/p1546084693076000). I think there's a way to have your cake and eat it, too - split off the update logic.

After the split, there'd be two libraries:

  • tzdata which has the pure code, just the time zone access;
  • tzdata_updater which has the side-effecting code that does the updates.

That way, downstream libraries like timex can just depend on the tzdata library and nothing unexpected will happen (nor will maintainers of downstream libraries be forced to make a decision on whether this behaviour is wanted or not - they can't, only the end user can). If someone wants the update behaviour, that is simple enough to accomplish by adding the tzdata_updater dependency as well. No messing around with Mix configs needed.

(needless to say, more than happy to chip in some time to make this happen)

lau commented

I cannot see the discussion you linked to because it requires a login.

The update behaviour is explained in the readme https://github.com/lau/tzdata#automatic-data-updates It is very easy to change the setting using the config setting config :tzdata, :autoupdate, :disabled

lau commented

For people that do not bother to read the readme of the libraries the use, I believe that auto updating is the best default. For most people including those that care to read the readmes of the libraries they use, they can choose to disable the auto updating and instead keep up with new tzdata versions every single day and make sure to update to new versions within 24 hours manually.