feat(growth): load data on application start

To make this possible, the following changes were made:

* Use `Task` to start the load process
* Create `ets` table before start the async task
  * This is needed to keep the tables alive after the task process exits
* Adjust the application to start the `Growth.Indicators.Load` task
This commit is contained in:
2024-06-10 12:11:18 +00:00
parent 412250d7ef
commit b415b38184
2 changed files with 33 additions and 13 deletions

View File

@@ -16,9 +16,10 @@ defmodule Wabanex.Application do
# Start the PubSub system
{Phoenix.PubSub, name: Wabanex.PubSub},
# Start the Endpoint (http/https)
WabanexWeb.Endpoint
WabanexWeb.Endpoint,
# Start a worker by calling: Wabanex.Worker.start_link(arg)
# {Wabanex.Worker, arg}
{Growth.Indicators.Load, []}
]
# See https://hexdocs.pm/elixir/Supervisor.html