Add random caching

This commit is contained in:
2022-04-02 16:56:34 +03:00
parent f1f320da9b
commit 2f6a4a192a
7 changed files with 86 additions and 14 deletions

View File

@@ -36,7 +36,7 @@ class SequenceTGRMSearchService(TRGMSearchService):
GET_OBJECT_IDS_QUERY = GET_OBJECT_IDS_QUERY
GET_OBJECT_ID_QUERY = """
GET_OBJECTS_ID_QUERY = """
WITH filtered_sequences AS (
SELECT id FROM sequences
WHERE EXISTS (
@@ -55,7 +55,7 @@ ORDER BY RANDOM() LIMIT 1;
class GetRandomSequenceService(GetRandomService):
MODEL_CLASS = Sequence
GET_OBJECT_ID_QUERY = GET_OBJECT_ID_QUERY
GET_OBJECTS_ID_QUERY = GET_OBJECTS_ID_QUERY
class SequenceMeiliSearchService(MeiliSearchService):