From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 82CE51F619; Tue, 19 Jul 2022 22:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1658270573; bh=TBe4wF6qxUSTeceJIxHevXFzdn6EFD8usToWEA26OOA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DkVXxklb5cx/hfnmwUQ0h3kFSIE00RiVhVhQKZbCt5FMQHIpoeMYRbFJ/Sz1aEl/P BrPfq5ocVBxCNsVXV1CqZCcvq5TCMzt6mBBEerHah+wrrdAj9fn13q4yd4ga3X8FSA bGzi00nYlpyeMjudzCZqjLj3wKtRVirg8PeGhGTo= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] lei note-event: inline note_event_arm_done Date: Tue, 19 Jul 2022 22:42:53 +0000 Message-Id: <20220719224253.3218929-3-e@80x24.org> In-Reply-To: <20220719224253.3218929-1-e@80x24.org> References: <20220719224253.3218929-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/PublicInbox/LeiNoteEvent.pm b/lib/PublicInbox/LeiNoteEvent.pm index 93f80116..8581bd9a 100644 --- a/lib/PublicInbox/LeiNoteEvent.pm +++ b/lib/PublicInbox/LeiNoteEvent.pm @@ -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; };