Skip to content

Commit 05aa5ba

Browse files
committed
Use the right exception, update logging to ignore
1 parent 1cc7606 commit 05aa5ba

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/olympia/lib/settings_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ def get_language_url_map():
926926
'level': logging.WARNING,
927927
'propagate': True,
928928
},
929-
'elasticsearch': {
929+
'elastic_transport.transport': {
930930
'handlers': ['null'],
931931
'level': logging.INFO,
932932
'propagate': False,

src/olympia/search/management/commands/reindex.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ def execute_workflow(self, workflow):
268268
self.stdout.write('\n')
269269

270270
# Let's return the /_aliases values.
271-
aliases = ES.indices.get_alias()
272-
aliases = json.dumps(aliases, sort_keys=True, indent=4)
271+
aliases = json.dumps(dict(ES.indices.get_alias()), sort_keys=True, indent=4)
273272
summary = _SUMMARY % aliases
274273
self.stdout.write(summary)

src/olympia/search/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from django.conf import settings
66
from django.core.management.base import CommandError
77

8-
from elasticsearch import Elasticsearch, TransportError, helpers, transport
8+
from elasticsearch import Elasticsearch, helpers, transport
9+
from elasticsearch.exceptions import NotFoundError
910

1011
from .models import Reindexing
1112

@@ -74,7 +75,7 @@ def unindex_objects(ids, indexer_class):
7475
for id_ in ids:
7576
try:
7677
es.delete(index=index, id=id_)
77-
except TransportError:
78+
except NotFoundError:
7879
# We ignore already deleted objects.
7980
pass
8081

0 commit comments

Comments
 (0)