Skip to content

Commit

Permalink
Retry fetching LastTrip info before crashing.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaddox5 committed Nov 22, 2024
1 parent 0f80384 commit 912d745
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/screens/last_trip/trip_updates/gtfs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ defmodule Screens.LastTrip.TripUpdates.GTFS do
"""
@behaviour Screens.LastTrip.TripUpdates

use Retry.Annotation

@impl true
@retry with: Stream.take(constant_backoff(500), 5)
def get do
trip_updates_url = Application.fetch_env!(:screens, :trip_updates_url)

Expand Down
3 changes: 3 additions & 0 deletions lib/screens/last_trip/vehicle_positions/gtfs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ defmodule Screens.LastTrip.VehiclePositions.GTFS do
"""
@behaviour Screens.LastTrip.VehiclePositions

use Retry.Annotation

@impl true
@retry with: Stream.take(constant_backoff(500), 5)
def get do
vehicle_positions_url = Application.fetch_env!(:screens, :vehicle_positions_url)

Expand Down

0 comments on commit 912d745

Please sign in to comment.