Skip to content

Commit

Permalink
Remove anon v1 full trending tracks cache
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsolo committed Oct 5, 2023
1 parent 139221f commit e243d46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions discovery-provider/src/api/v1/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
from src.queries.get_track_stream_signature import get_track_stream_signature
from src.queries.get_tracks import RouteArgs, get_tracks
from src.queries.get_tracks_including_unlisted import get_tracks_including_unlisted
from src.queries.get_trending import get_full_trending, get_trending
from src.queries.get_trending import get_trending
from src.queries.get_trending_ids import get_trending_ids
from src.queries.get_trending_tracks import TRENDING_LIMIT, TRENDING_TTL_SEC
from src.queries.get_unclaimed_id import get_unclaimed_id
Expand Down Expand Up @@ -683,7 +683,7 @@ def get(self, version):
strategy = trending_strategy_factory.get_strategy(
TrendingType.TRACKS, version_list[0]
)
trending_tracks = get_full_trending(request, args, strategy)
trending_tracks = get_trending(args, strategy)
return success_response(trending_tracks)


Expand Down
13 changes: 0 additions & 13 deletions discovery-provider/src/queries/get_trending.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,3 @@ def get_trending(args, strategy):

tracks = get_trending_tracks(args, strategy)
return list(map(extend_track, tracks))


def get_full_trending(request, args, strategy):
key = get_trending_cache_key(to_dict(request.args), request.path)

# Attempt to use the cached tracks list
if args["user_id"] is not None:
full_trending = get_trending(args, strategy)
else:
full_trending = use_redis_cache(
key, TRENDING_TTL_SEC, lambda: get_trending(args, strategy)
)
return full_trending

0 comments on commit e243d46

Please sign in to comment.