import envoy import gleam/erlang/process import gleam/otp/static_supervisor import gleam/result import protogizz/consumer import protogizz/store pub fn main() -> Nil { let store_name = process.new_name("store") let db_path = envoy.get("PROTOGIZZ_DB") |> result.unwrap("./data/protogizz.db") let tap_url = envoy.get("PROTOGIZZ_TAP_URL") |> result.unwrap("http://localhost:2480/channel") let assert Ok(_) = static_supervisor.new(static_supervisor.OneForOne) |> static_supervisor.add(store.supervised(store_name, db_path)) |> static_supervisor.add(consumer.supervised(store_name, tap_url)) |> static_supervisor.restart_tolerance(10, 30) |> static_supervisor.start process.sleep_forever() }