-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(ScheduleController): Fetch schedules by individual stop for more…
… cache hits (#231) * perf(ScheduleController): Fetch schedules by individual stop for more cache hits As implemented, if any request for a stop fails, the entire request fails. This is to preserve the existing all-or-nothing behavior for fetching schedules for all stops together. If we want to have partial failure states in the future, we'll want to adopt a frontend changes to represent the partial failure state. * perf(MBTAV3API.Repository): Cache schedules responses for 1 hour * feat(locustfile): Represent global data caching * feat(load_testing): more realistic stop distribution * fix(RepositoryCache): Actually start the cache * style(locustfile): run linting * perf(Repository): Try TTL cache for all static GTFS requests * fix(RepositoryTest): clear cache * fix(Locustfile): More realistic nearby stops numbers * perf(ScheduleController): Don't use task when only one stop * perf(ScheduleController): Only make requests async when more than 1 * test(Repository): Test schedules actually cached * cleanup(locustfile): stray prints * revert locustfile changes for separate PR * refactor(Repository): Cache all/3, remove unused alerts fn * feat(ScheduleController): unordered tasks & unsorted schedule list * style: fix formatting * fix(ScheduleControllerTest): Remove sorting expectation
- Loading branch information
1 parent
587b798
commit fdaf777
Showing
10 changed files
with
382 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
defmodule MBTAV3API.RepositoryCache do | ||
@moduledoc """ | ||
Cache used to reduce the number of calls to the V3 API. | ||
""" | ||
use Nebulex.Cache, otp_app: :mobile_app_backend, adapter: Nebulex.Adapters.Local | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.