ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Make importer quieter when DB errors occur
Date Sat, 05 Nov 2016 19:11:50 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master e51725ebd -> 57e4b2c18


Make importer quieter when DB errors occur


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/57e4b2c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/57e4b2c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/57e4b2c1

Branch: refs/heads/master
Commit: 57e4b2c18a24eac9ba075e76178d72ddf8a534be
Parents: e51725e
Author: Sebb <sebb@apache.org>
Authored: Sat Nov 5 19:07:11 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Sat Nov 5 19:11:32 2016 +0000

----------------------------------------------------------------------
 tools/import-mbox.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/57e4b2c1/tools/import-mbox.py
----------------------------------------------------------------------
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index 1476779..c2e2c62 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -110,8 +110,13 @@ class BulkThread(Thread):
     def insert(self):
         global config
         sys.stderr.flush()
-        if not self.xes.indices.exists(dbname):
-            self.xes.indices.create(index = dbname)
+        # thread code writes exceptions to stderr so capture and log a summary ourselves
+        try:
+            if not self.xes.indices.exists(dbname):
+                self.xes.indices.create(index = dbname)
+        except Exception as err:
+            print("Warning: Could not create the index %s: %s" % (dbname,err))
+            return
 
         js_arr = []
         i = 0


Mime
View raw message