Commit 221b2520 authored by Michal Čihař's avatar Michal Čihař

Use async writer when deleting units from index

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent e67f95cb
...@@ -322,9 +322,8 @@ def clean_search_unit(pk, lang): ...@@ -322,9 +322,8 @@ def clean_search_unit(pk, lang):
def delete_search_unit(pk, lang): def delete_search_unit(pk, lang):
try: try:
index = get_target_index(lang) for index in (get_source_index(), get_target_index(lang)):
index.writer().delete_by_term('pk', pk) with AsyncWriter(index) as writer:
index = get_source_index() writer.delete_by_term('pk', pk)
index.writer().delete_by_term('pk', pk)
except IOError: except IOError:
return return
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment