This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new a35c618  some more elastic fixes for archiver
a35c618 is described below

commit a35c618e7e465790f6a32051e4406af1518357d9
Author: Daniel Gruno <[email protected]>
AuthorDate: Mon Aug 17 15:06:21 2020 +0200

    some more elastic fixes for archiver
---
 tools/archiver.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index 8bc4f17..f53c9e3 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -557,10 +557,10 @@ class Archiver(object):  # N.B. Also used by 
import-mbox.py
             and mlist.description
             and mlist.list_name
         ):
-            self.index(
+            self.elastic.index(
                 index=self.elastic.db_mailinglist,
                 id=lid,
-                consistency=self.consistency,
+                consistency=self.elastic.consistency,
                 body={
                     "list": lid,
                     "name": mlist.list_name,
@@ -579,14 +579,14 @@ class Archiver(object):  # N.B. Also used by 
import-mbox.py
             if dm:
                 cid = dm.group(1)
                 mid = dm.group(2)
-                if self.elastic.exists(index=self.dbname, doc_type="account", 
id=cid):
-                    doc = self.elastic.get(index=self.dbname, 
doc_type="account", id=cid)
+                if self.elastic.exists(index=self.elastic.db_account, id=cid):
+                    doc = self.elastic.get(index=self.elastic.db_account, 
id=cid)
                     if doc:
                         oldrefs.append(cid)
                         # N.B. no index is supplied, so ES will generate one
                         self.index(
                             index=self.elastic.db_notification,
-                            consistency=self.consistency,
+                            consistency=self.elastic.consistency,
                             body={
                                 "type": "direct",
                                 "recipient": cid,
@@ -613,8 +613,9 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
             ):
                 cid = im.group(1)
                 mid = im.group(2)
-                if self.elastic.exists(index=self.dbname, id=cid):
-                    doc = self.elastic.get(index=self.dbname, id=cid)
+                # TODO: Fix this to work with pibbles
+                if self.elastic.exists(index=self.elastic.db_mbox, id=cid):
+                    doc = self.elastic.get(index=self.elastic.db_mbox, id=cid)
 
                     # does the user want to be notified of indirect replies?
                     if (
@@ -625,10 +626,9 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
                         and cid not in oldrefs
                     ):
                         oldrefs.append(cid)
-                        # N.B. no index is supplied, so ES will generate one
-                        self.index(
+                        # N.B. no index mapping is supplied, so ES will 
generate one
+                        self.elastic.index(
                             index=self.elastic.db_notification,
-                            consistency=self.consistency,
                             body={
                                 "type": "indirect",
                                 "recipient": cid,

Reply via email to