]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei note-event: inline note_event_arm_done
authorEric Wong <e@80x24.org>
Tue, 19 Jul 2022 22:42:53 +0000 (22:42 +0000)
committerEric Wong <e@80x24.org>
Wed, 20 Jul 2022 03:54:28 +0000 (03:54 +0000)
This was a single-caller sub since 47d4e53734820b4e
(lei_mail_sync: rely on flock(2), avoid IPC, 2021-09-18)
and unlikely to be used further, so inline it and save
a few KB of memory.

lib/PublicInbox/LeiNoteEvent.pm

index 93f80116caa69993f29af63365255dc38aeb77d8..8581bd9af7f6c9318413bf98cf5846b0adc414cf 100644 (file)
@@ -27,13 +27,6 @@ sub flush_task { # PublicInbox::DS timer callback
        for my $lei (values %$todo) { flush_lei($lei) }
 }
 
-# sets a timer to flush
-sub note_event_arm_done ($) {
-       my ($lei) = @_;
-       PublicInbox::DS::add_uniq_timer('flush_timer', 5, \&flush_task);
-       $to_flush->{$lei->{cfg}->{'-f'}} //= $lei;
-}
-
 sub eml_event ($$$$) {
        my ($self, $eml, $vmd, $state) = @_;
        my $sto = $self->{lei}->{sto};
@@ -92,7 +85,8 @@ sub lei_note_event {
                $jobs = 4 if $jobs > 4; # same default as V2Writable
                my ($op_c, $ops) = $lei->workers_start($wq, $jobs);
                $lei->wait_wq_events($op_c, $ops);
-               note_event_arm_done($lei);
+               PublicInbox::DS::add_uniq_timer('flush_timer', 5, \&flush_task);
+               $to_flush->{$lei->{cfg}->{'-f'}} //= $lei;
                $wq->prepare_nonblock;
                $lei->{lne} = $wq;
        };