From: Eric Wong Date: Thu, 21 Oct 2021 21:10:28 +0000 (+0000) Subject: lei note-event: clear_src on ENOENT X-Git-Tag: v1.7.0~86 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=0c6132ee390667ad643f6aa6053f978f4267b2e4 lei note-event: clear_src on ENOENT When a file goes away, try to make sure we don't waste time trying to access or store it. --- diff --git a/lib/PublicInbox/LeiNoteEvent.pm b/lib/PublicInbox/LeiNoteEvent.pm index 3472e730..22d6ffac 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 {