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 {
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to