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

Fam Zheng fam at euphon.net
Mon Jan 14 03:02:29 UTC 2019



> On Jan 11, 2019, at 16:46, Paolo Bonzini <pbonzini at redhat.com> wrote:
> 
> 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.

Yes, good idea!

Reviewed-by: Fam Zheng <fam at euphon.net>

> 
> 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
> 
> _______________________________________________
> Patchew-devel mailing list
> Patchew-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/patchew-devel





More information about the Patchew-devel mailing list