]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei note-event: always flush changes on daemon exit
authorEric Wong <e@80x24.org>
Tue, 31 Aug 2021 11:21:22 +0000 (11:21 +0000)
committerEric Wong <e@80x24.org>
Tue, 31 Aug 2021 11:29:11 +0000 (11:29 +0000)
Because the timer may not fire in time before daemon shutdown.

lib/PublicInbox/LEI.pm

index 28fe0c836d7a3e842217b9bfd3cf63ac8ece2bf8..520fb51940f14b29913885ad11d9df69d96c0241 100644 (file)
@@ -1254,6 +1254,7 @@ sub lazy_start {
                my (undef, $eof_p) = PublicInbox::PktOp->pair;
                sub {
                        $exit_code //= shift;
+                       eval 'PublicInbox::LeiNoteEvent::flush_task()';
                        my $lis = $pil or exit($exit_code);
                        # closing eof_p triggers \&noop wakeup
                        $listener = $eof_p = $pil = $path = undef;