Skip to content

Commit

Permalink
Fix ES indexing timeout
Browse files Browse the repository at this point in the history
I missed a spot earlier when I changed indexing to use an ES with
timeout=settings.ES_INDEXING_TIMEOUT. This only affects incremental
indexing where it gets its own ES.

In the process of fixing that one line, I renamed es_utils.get_es
to es_utils.get_indexing_es so it's clearer what it's for.
  • Loading branch information
willkg committed Jan 25, 2012
1 parent f2b4463 commit 53f3b1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/search/es_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def get_doctype_stats():
return stats


def get_es(**kwargs):
"""Returns a fresh ES instance
def get_indexing_es(**kwargs):
"""Returns a fresh ES instance for indexing
Defaults for these arguments come from settings. Specifying them
in the function call will override the default.
Expand Down
6 changes: 4 additions & 2 deletions apps/search/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def index_all(cls, percent=100):
100--e.g. all of them.
"""
es = es_utils.get_es()
es = es_utils.get_indexing_es()

doc_type = cls._meta.db_table
index = settings.ES_INDEXES['default']
Expand Down Expand Up @@ -168,7 +168,9 @@ def index(cls, document, bulk=False, force_insert=False, refresh=False,
return

if es is None:
es = elasticutils.get_es()
# Use the es_utils get_es because it uses
# ES_INDEXING_TIMEOUT.
es = es_utils.get_indexing_es()

index = settings.ES_INDEXES['default']
doc_type = cls._meta.db_table
Expand Down

0 comments on commit 53f3b1c

Please sign in to comment.