Skip to content

Commit

Permalink
Added new repo model to green
Browse files Browse the repository at this point in the history
  • Loading branch information
kotva006 committed May 8, 2024
1 parent 6bfb63a commit fed8c3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/dotcom_web/controllers/schedule/green.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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, [])
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fed8c3f

Please sign in to comment.