]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiNoteEvent.pm
lei note-event: inline note_event_arm_done
[public-inbox.git] / 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;
        };