Skip to content

Commit 0880650

Browse files
committed
move constant to env ELASTICSEARCH_POST_INDEX_DELAY
1 parent f770082 commit 0880650

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

project/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ def split(string, delim):
314314
'TIMEOUT': int(os.environ.get('ELASTICSEARCH_TIMEOUT', '45')),
315315
'CHUNK_SIZE': int(os.environ.get('ELASTICSEARCH_CHUNK_SIZE', 2000)),
316316
'MAX_RETRIES': int(os.environ.get('ELASTICSEARCH_MAX_RETRIES', 7)),
317+
'POST_INDEX_DELAY': int(os.environ.get('ELASTICSEARCH_POST_INDEX_DELAY', 3)),
317318
}
318319
ELASTICSEARCH5_URL = (
319320
os.environ.get('ELASTICSEARCH5_URL')

share/search/index_strategy/trovesearch_denorm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def after_chunk(self, messages_chunk: messages.MessagesChunk, indexnames: Iterab
162162
'card_pks': messages_chunk.target_ids_chunk,
163163
'timestamp': messages_chunk.timestamp,
164164
},
165-
countdown=3, # TODO: config?
165+
countdown=settings.ELASTICSEARCH['POST_INDEX_DELAY'],
166166
)
167167

168168
# abstract method from Elastic8IndexStrategy

0 commit comments

Comments
 (0)