Skip to content

Commit

Permalink
Revert "netflixtop10: Add more granular cache"
Browse files Browse the repository at this point in the history
This reverts commit d352124.
  • Loading branch information
rohansingh committed Sep 28, 2024
1 parent e366084 commit fee35a7
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions apps/netflixtop10/netflix_top_10.star
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,6 @@ def load_global_table():
return parse_tsv(body)

def get_rows_for_display(region, category):
cache_key = "rows-%s-%s" % (region, category)

val = cache.get(cache_key)
if val != None:
return json.decode(val)

data = load_global_table() if region == "global" else load_countries_table()
if data == None:
return [{"show_title": "Error loading chart"}]
Expand All @@ -210,8 +204,6 @@ def get_rows_for_display(region, category):
filtered = [row for row in data if matches(row)]
rows = sorted(filtered, key = lambda row: int(row["weekly_rank"]))

cache.set(cache_key, json.encode(rows), ttl_seconds = 60 * 60)

return rows

def parse_tsv(tsvString):
Expand Down

0 comments on commit fee35a7

Please sign in to comment.