From nobody Wed Apr 24 10:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15471225487401018.3263187721484; Thu, 10 Jan 2019 04:15:48 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E152432D7; Thu, 10 Jan 2019 12:15:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4EC3371D41; Thu, 10 Jan 2019 12:15:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 400E53F600; Thu, 10 Jan 2019 12:15:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0ACFjhe018810 for ; Thu, 10 Jan 2019 07:15:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 96A0E60923; Thu, 10 Jan 2019 12:15:45 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-43.ams2.redhat.com [10.36.112.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8CC860A35; Thu, 10 Jan 2019 12:15:44 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 10 Jan 2019 13:15:43 +0100 Message-Id: <20190110121543.23124-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: patchew-devel@redhat.com Cc: dcaratti@redhat.com Subject: [Patchew-devel] [PATCH] patchew-importer: number import invocation in the logs X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 10 Jan 2019 12:15:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When importing a large number of messages it can be useful to know how the = process is progressing. Offlineimap numbers the message it imports, but the subseq= uent import phase does not. Add a number to the import, which can be correlated= with the logs that were printed during the offlineimap phase. Signed-off-by: Paolo Bonzini --- scripts/patchew-importer | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/patchew-importer b/scripts/patchew-importer index d9de74f..d70fc20 100755 --- a/scripts/patchew-importer +++ b/scripts/patchew-importer @@ -77,29 +77,32 @@ imported() =20 import() { - echo import $@ - if ! timeout -k 600 600 $PATCHEW_CLI import $@; then - cp $@ $BAD_MESSAGES_DIR + echo $1 import $2 + if ! timeout -k 600 600 $PATCHEW_CLI import $2; then + cp $2 $BAD_MESSAGES_DIR echo "(bad message saved in $BAD_MESSAGES_DIR)" fi if test "$IMAP_DELETE_AFTER_IMPORT" =3D y; then rm -f $f echo "Deleted $f" fi - touch $IMPORTED_DIR/$(hashstr $@) + touch $IMPORTED_DIR/$(hashstr $2) } =20 offlineimap_import() { + local n if ! timeout -k 2000 1800 offlineimap -c $offlineimap_rc; then sleep 300 return fi + n=3D1 find "$maildir" -type f | while read f; do if imported "$f"; then return fi - import "$f" || true + import $n "$f" || true + let n=3Dn+1 done } =20 --=20 2.20.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel