You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/05/05 13:44:00 UTC

[incubator-ponymail-foal] branch master updated: Ensure that all docs are migrated

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 d410629  Ensure that all docs are migrated
     new e386040  Merge pull request #14 from sbp/migrator-leftovers
d410629 is described below

commit d410629981590f7ff5a94059f9f557a23e8f11ef
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Wed May 5 11:08:29 2021 +0100

    Ensure that all docs are migrated
---
 tools/migrate.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/migrate.py b/tools/migrate.py
index 74c14f5..5f63a43 100644
--- a/tools/migrate.py
+++ b/tools/migrate.py
@@ -135,7 +135,7 @@ async def main():
 
         if len(bulk_array) > 100:
             await bulk_push(bulk_array)
-            bulk_array = []
+            bulk_array[:] = []
 
         processed += 1
         if processed % 500 == 0:
@@ -156,6 +156,10 @@ async def main():
                   (processed, (no_emails - processed), time_left_str, docs_per_second)
                   )
 
+    # There may be some docs left over to push
+    if bulk_array:
+        await bulk_push(bulk_array)
+
     start_time = time.time()
     processed = 0
     count = await es.count(index=old_dbname, doc_type="attachment")