[Patchew-devel] [PATCH] patchew-importer: import Maildir into Patchew before syncing IMAP

Paolo Bonzini pbonzini at redhat.com
Fri Jan 11 08:46:39 UTC 2019


This is more effective when the container is stopped and restarted in
the middle of an importer run.  Previously, all the messages on the
IMAP server would be imported again and again, causing sort of a
quadratic behavior.

Now, instead, the messages are deleted on the maildir as soon as the
container is restarted, and the subsequent offlineimap run will both
delete them and read new messages.

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 scripts/patchew-importer | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/patchew-importer b/scripts/patchew-importer
index 41e66ba..2e6cf04 100755
--- a/scripts/patchew-importer
+++ b/scripts/patchew-importer
@@ -108,7 +108,6 @@ offlineimap_import()
 
 while :; do
     $PATCHEW_CLI login "$PATCHEW_USER" "$PATCHEW_PASS"
-    offlineimap_import
     while :; do
         wd=$(mktemp -d /var/tmp/patchew-applier.XXXXX)
         if (cd $wd; $PATCHEW_CLI apply --applier-mode); then
@@ -121,5 +120,6 @@ while :; do
         fi
     done
     $PATCHEW_CLI project update
+    offlineimap_import
     sleep 60
 done
-- 
2.20.1




More information about the Patchew-devel mailing list