From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9A9741FD5F for ; Thu, 21 Oct 2021 21:10:33 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 11/15] lei note-event: clear_src on ENOENT Date: Thu, 21 Oct 2021 21:10:28 +0000 Message-Id: <20211021211032.22666-12-e@80x24.org> In-Reply-To: <20211021211032.22666-1-e@80x24.org> References: <20211021211032.22666-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: When a file goes away, try to make sure we don't waste time trying to access or store it. --- lib/PublicInbox/LeiNoteEvent.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LeiNoteEvent.pm b/lib/PublicInbox/LeiNoteEvent.pm index 3472e73070d6..22d6ffac9feb 100644 --- a/lib/PublicInbox/LeiNoteEvent.pm +++ b/lib/PublicInbox/LeiNoteEvent.pm @@ -8,6 +8,7 @@ use strict; use v5.10.1; use parent qw(PublicInbox::IPC); use PublicInbox::DS; +use Errno qw(ENOENT); our $to_flush; # { cfgpath => $lei } @@ -59,8 +60,11 @@ sub eml_event ($$$$) { sub maildir_event { # via wq_io_do my ($self, $fn, $vmd, $state) = @_; - my $eml = PublicInbox::InboxWritable::eml_from_path($fn) // return; - eml_event($self, $eml, $vmd, $state); + if (my $eml = PublicInbox::InboxWritable::eml_from_path($fn)) { + eml_event($self, $eml, $vmd, $state); + } elsif ($! == ENOENT) { + $self->{lms}->clear_src(@{$vmd->{sync_info}}); + } # else: eml_from_path already warns } sub lei_note_event {