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-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 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 70BF91F9FF for ; Fri, 26 Mar 2021 04:29:37 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/3] lei: _lei_store: use default even if unconfigured Date: Fri, 26 Mar 2021 06:29:36 +0200 Message-Id: <20210326042937.15913-3-e@80x24.org> In-Reply-To: <20210326042937.15913-1-e@80x24.org> References: <20210326042937.15913-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Perhaps leistore.dir doesn't need to have a config file entry if we're using the default location. --- lib/PublicInbox/LEI.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index d534f1d0..b42ba0ae 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -719,8 +719,8 @@ sub _lei_store ($;$) { my $cfg = _lei_cfg($self, $creat); $cfg->{-lei_store} //= do { require PublicInbox::LeiStore; - my $dir = $cfg->{'leistore.dir'}; - $dir //= $creat ? store_path($self) : return; + my $dir = $cfg->{'leistore.dir'} // store_path($self); + return unless $creat || -d $dir; PublicInbox::LeiStore->new($dir, { creat => $creat }); }; }