Skip to content

Commit 63ee4ef

Browse files
Merge pull request #1277 from openml/feature/do_not_index_es_during_startup
Optionally do not index es during startup
2 parents be80b96 + 239afe5 commit 63ee4ef

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

docker/set_configuration.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ sed "s*'ES_PASSWORD', 'FILL_IN'*'ES_PASSWORD', '${ES_PASSWORD:-default}'*g" --in
3030

3131
sed "s/define('ENVIRONMENT', '.*')/define('ENVIRONMENT', '${PHP_ENVIRONMENT:-production}')/" --in-place ${INDEX_PATH}
3232

33+
cd /var/www/openml
3334

34-
indices=('downvote', 'study', 'data', 'task', 'download', 'user', 'like', 'measure', 'flow', 'task_type', 'run')
35-
for index in "${indices[@]}"
36-
do
37-
curl -X DELETE ${ES_URL:-elasticsearch:9200}/${index}?ignore_unavailable=true
38-
done
35+
INDEX_ES_DURING_STARTUP=${INDEX_ES_DURING_STARTUP:-true}
36+
if [ "$INDEX_ES_DURING_STARTUP" = true ] ; then
37+
indices=('downvote', 'study', 'data', 'task', 'download', 'user', 'like', 'measure', 'flow', 'task_type', 'run')
38+
for index in "${indices[@]}"
39+
do
40+
curl -X DELETE ${ES_URL:-elasticsearch:9200}/${index}?ignore_unavailable=true
41+
done
3942

40-
cd /var/www/openml
41-
php index.php cron build_es_indices
43+
php index.php cron build_es_indices
44+
fi
4245

4346
apache2-foreground

0 commit comments

Comments
 (0)