custom-encoder-fix

This commit is contained in:
2024-03-06 21:57:04 +03:00
parent 4aa4303a59
commit 2b89ab7c78
4 changed files with 22 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ import os
from opensearchpy import OpenSearch
from services.encoders import CustomJSONEncoder
from services.logger import root_logger as logger
from services.rediscache import redis
@@ -144,7 +145,7 @@ class SearchService:
# Use Redis as cache with TTL
redis_key = f'search:{text}'
await redis.execute('SETEX', redis_key, REDIS_TTL, json.dumps(results))
await redis.execute('SETEX', redis_key, REDIS_TTL, json.dumps(results), cls=CustomJSONEncoder)
return []