Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get tracks by removing shared cache #3810

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions discovery-provider/src/queries/get_tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from src.models.tracks.track_route import TrackRoute
from src.models.tracks.track_with_aggregates import TrackWithAggregates
from src.models.users.user import User
from src.queries.get_unpopulated_tracks import get_unpopulated_tracks
from src.queries.query_helpers import (
SortDirection,
SortMethod,
Expand Down Expand Up @@ -245,22 +244,6 @@ def get_tracks_and_ids():
if not args["routes"]:
return ([], [])

can_use_shared_cache = (
"id" in args
and "min_block_number" not in args
and "sort" not in args
and "sort_method" not in args
and "user_id" not in args
)

if can_use_shared_cache:
should_filter_deleted = args.get("filter_deleted", False)
tracks = get_unpopulated_tracks(
session, args["id"], should_filter_deleted
)
track_ids = list(map(lambda track: track["track_id"], tracks))
return (tracks, track_ids)

(limit, offset) = get_pagination_vars()
args["limit"] = limit
args["offset"] = offset
Expand Down