aboutsummaryrefslogtreecommitdiff
path: root/watch/utils.py
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-08-31 01:11:17 -0400
committerBobby <[email protected]>2024-08-31 01:11:17 -0400
commit670cbd18b5729bb7d1e4c1e61c9b47d343ddec8a (patch)
treeb5f7488236cff1be21dcc3eda6c49cc66bef76f4 /watch/utils.py
parentd6402c0b3fde39ee411f06fa67c1512a14990a26 (diff)
downloadyugen-670cbd18b5729bb7d1e4c1e61c9b47d343ddec8a.tar.xz
yugen-670cbd18b5729bb7d1e4c1e61c9b47d343ddec8a.zip
removed debug stmts
Diffstat (limited to 'watch/utils.py')
-rw-r--r--watch/utils.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/watch/utils.py b/watch/utils.py
index b7c3a16..1b0435f 100644
--- a/watch/utils.py
+++ b/watch/utils.py
@@ -12,19 +12,13 @@ r = redis.Redis(
ssl=True,
)
-# delete everything from redis cache
-r.flushall()
-print("cache flushed")
-
def update_anime_user_history(user, anime_id, episode, time_watched):
# per episode history
- print("updating history")
history, created = UserHistory.objects.get_or_create(user=user, anime_id=anime_id, episode=episode)
history.time_watched = time_watched
# last watched
last_watched = UserHistory.objects.filter(user=user, anime_id=anime_id, last_watched=True)
- print(last_watched)
if last_watched:
last_watched = last_watched[0]
last_watched.last_watched = False
@@ -40,9 +34,7 @@ def get_anime_user_history(user, anime_id):
def store_in_redis_cache(anime_id, data):
r.set(anime_id, data, ex=60*60) # 1 hour
- print("data cached", anime_id)
def get_from_redis_cache(anime_id):
data = r.get(anime_id)
- print("data fetched from cache", anime_id)
return data