From 1e20af50008938ccfb20c98e896f993b221e25e0 Mon Sep 17 00:00:00 2001 From: mathieuprog <5883963+mathieuprog@users.noreply.github.com> Date: Sat, 1 May 2021 13:17:29 +0200 Subject: [PATCH] Update Readme --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 7dacdd6..c7622ab 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,25 @@ If you do not wish to update automatically, but still wish to be alerted for new This will simply log to your server when a new time zone database is available. +To avoid the updater to run while executing tests, you may conditionally add the child worker in your supervisor. For +example: + +```elixir +children = [ + MyApp.RepoBase, + MyApp.Endpoint, +] +|> append_if(Application.get_env(:my_app, :env) != :test, {Tz.UpdatePeriodically, []}) +``` + +```elixir +defp append_if(list, condition, item) do + if condition, do: list ++ [item], else: list +end +``` + +In `config.exs`, add `config :calendar_storefront, env: Mix.env()`. + Lastly, add the http client `mint` and ssl certificate store `castore` into your `mix.exs` file: ```elixir