add comment and align time from gen and stream to 30mins

This commit is contained in:
fadingNA
2024-10-14 12:09:13 -04:00
parent 8ce1fd561d
commit f5661b3b1e
3 changed files with 4 additions and 9862 deletions

View File

@@ -70,7 +70,10 @@ def gen_cache(func):
return cached_response.decode('utf-8')
result = func(self, model, messages, *args, **kwargs)
redis_client.set(cache_key, result, ex=3600)
# expire the cache after 30 minutes
# set time in seconds
redis_client.set(cache_key, result, ex=1800)
return result
except ValueError as e: