Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1713 Fix reading DB_CURSOR_ON env
Browse files Browse the repository at this point in the history
  • Loading branch information
rkorytkowski committed Dec 13, 2023
1 parent 0fdee2d commit b75e4a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def get_exact_or_criteria(attr, values):
def batch_index(queryset, document, single_batch=False):
if not get(settings, 'TEST_MODE'):
if single_batch or not get(settings, 'DB_CURSOR_ON', True):
document().update(queryset, parallel=True)
document().update(queryset.all(), parallel=True)
else:
for batch in queryset.iterator(chunk_size=500):
document().update(batch, parallel=True)
Expand Down
2 changes: 1 addition & 1 deletion core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
}
}

DB_CURSOR_ON = os.environ.get('DB_CURSOR_ON', True)
DB_CURSOR_ON = os.environ.get('DB_CURSOR_ON', 'true').lower() == 'true'

ES_HOST = os.environ.get('ES_HOST', 'es') # Deprecated. Use ES_HOSTS instead.
ES_PORT = os.environ.get('ES_PORT', '9200') # Deprecated. Use ES_HOSTS instead.
Expand Down

0 comments on commit b75e4a5

Please sign in to comment.