From fed8c3f7a328d70b7d2c012bf23541da96b96ba9 Mon Sep 17 00:00:00 2001 From: kotva006 Date: Wed, 8 May 2024 14:23:09 -0500 Subject: [PATCH] Added new repo model to green --- lib/dotcom_web/controllers/schedule/green.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dotcom_web/controllers/schedule/green.ex b/lib/dotcom_web/controllers/schedule/green.ex index 9b3f78be41..5ad7922842 100644 --- a/lib/dotcom_web/controllers/schedule/green.ex +++ b/lib/dotcom_web/controllers/schedule/green.ex @@ -31,6 +31,7 @@ defmodule DotcomWeb.ScheduleController.Green do plug(:channels) @task_timeout 10_000 + @predictions_repo Application.compile_env!(:dotcom, :repo_modules)[:predictions] def show(%Plug.Conn{query_params: %{"tab" => "alerts"}} = conn, _params), do: alerts(conn, []) @@ -75,7 +76,7 @@ defmodule DotcomWeb.ScheduleController.Green do def predictions(conn, opts) do {predictions, vehicle_predictions} = if DotcomWeb.ScheduleController.Predictions.should_fetch_predictions?(conn) do - predictions_fn = opts[:predictions_fn] || (&Predictions.Repo.all/1) + predictions_fn = opts[:predictions_fn] || Function.capture(@predictions_repo, :all, 1) predictions_stream = conn