Handle empty ttl in backend

This commit is contained in:
Devoalda 2023-10-23 15:58:15 +08:00
parent a6faf8720d
commit 4e72bcfe07
1 changed files with 62 additions and 60 deletions

View File

@ -4,10 +4,12 @@ import uuid
from django.core.cache import cache from django.core.cache import cache
from rest_framework.decorators import api_view from rest_framework.decorators import api_view
from rest_framework.response import Response from rest_framework.response import Response
from django.conf import settings
@api_view(['POST']) @api_view(['GET', 'POST'])
def manage_items(request, *args, **kwargs): def manage_items(request, *args, **kwargs):
if request.method == 'POST':
# Define a timeout value (in seconds) # Define a timeout value (in seconds)
timeout = 5 timeout = 5