forked from infra/ansible
[mailman3] Fix index not being rebuilt
The index build was failing on xapian_haystack issue that happens when the mail is too long. This patch will skip those e-mails. See infra/tickets#13355 for more info. Signed-off-by: Michal Konecny <mkonecny@redhat.com>
This commit is contained in:
parent
c33602daf4
commit
8f12b3c681
2 changed files with 26 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
diff --git i/xapian_backend.py w/xapian_backend.py
|
||||
index 05e8fed..c2bdd95 100755
|
||||
--- i/xapian_backend.py
|
||||
+++ w/xapian_backend.py
|
||||
@@ -498,7 +498,10 @@ class XapianSearchBackend(BaseSearchBackend):
|
||||
document.add_term(document_id)
|
||||
|
||||
# finally, replace or add the document to the database
|
||||
- database.replace_document(document_id, document)
|
||||
+ try:
|
||||
+ database.replace_document(document_id, document)
|
||||
+ except xapian.InvalidArgumentError as ex:
|
||||
+ sys.stderr.write(str(ex) + '\n')
|
||||
|
||||
except UnicodeDecodeError:
|
||||
sys.stderr.write('Chunk failed.\n')
|
||||
|
|
@ -436,6 +436,16 @@
|
|||
notify:
|
||||
- Restart mailman3
|
||||
|
||||
# This is needed till https://github.com/notanumber/xapian-haystack/issues/77
|
||||
# is resolved
|
||||
- name: Apply xapian_haystack patch
|
||||
ansible.posix.patch:
|
||||
src: mailman3_patch/xapian_haystack_term_too_long.patch
|
||||
basedir: /usr/lib/python3.9/site-packages/
|
||||
tags:
|
||||
- mailman
|
||||
- patch
|
||||
|
||||
# Memcached
|
||||
- name: Set the memcached sysconfig file
|
||||
ansible.builtin.copy:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue