Skip to content

Commit

Permalink
Use default timeout settings
Browse files Browse the repository at this point in the history
  • Loading branch information
aviupadhyayula committed Feb 5, 2024
1 parent f76c2ef commit a7fb354
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@ def list(self, *args, **kwargs):
return Response(cached_object)

resp = super().list(*args, **kwargs)
cache.set(key, resp.data, 60 * 60)
cache.set(key, resp.data)
return resp

def retrieve(self, *args, **kwargs):
Expand All @@ -1956,7 +1956,7 @@ def retrieve(self, *args, **kwargs):
return Response(cached)

resp = super().retrieve(*args, **kwargs)
cache.set(key, resp.data, 60 * 60)
cache.set(key, resp.data)
return resp

def update(self, request, *args, **kwargs):
Expand Down Expand Up @@ -3860,7 +3860,7 @@ def get(self, request):
"extra_details": extra_details,
}
if response["success"]:
cache.set(key, response, 120)
cache.set(key, response, 60 * 2)
return Response(response)

def delete(self, request):
Expand Down Expand Up @@ -4146,7 +4146,7 @@ def get(self, request):
}

if res["success"]:
cache.set(key, res, 900)
cache.set(key, res, 60 * 15)
return Response(res)

def post(self, request):
Expand Down Expand Up @@ -4217,7 +4217,7 @@ def get(self, request, *args, **kwargs):
if val:
return Response(val)
resp = super().get(request, *args, **kwargs)
cache.set(key, resp.data, 5 * 60)
cache.set(key, resp.data, 60 * 5)
return resp

def put(self, request, *args, **kwargs):
Expand Down Expand Up @@ -4654,7 +4654,7 @@ def retrieve(self, *args, **kwargs):
return Response(cached)
app = self.get_object()
data = ClubApplicationSerializer(app).data
cache.set(key, data, 60 * 60)
cache.set(key, data)
return Response(data)

@action(detail=True, methods=["post"])
Expand Down Expand Up @@ -5235,7 +5235,7 @@ def list(self, *args, **kwargs):
serializer = self.get_serializer_class()
qs = self.get_queryset()
data = serializer(qs, many=True).data
cache.set(key, data, 60 * 60)
cache.set(key, data)

return Response(data)

Expand Down Expand Up @@ -5543,7 +5543,7 @@ def list(self, *args, **kwargs):
return Response(cached)

data = ApplicationQuestionSerializer(self.get_queryset(), many=True).data
cache.set(key, data, 60 * 60)
cache.set(key, data)
return Response(data)

@action(detail=False, methods=["post"])
Expand Down

0 comments on commit a7fb354

Please sign in to comment.