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.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 6B8471F61A for ; Thu, 19 Mar 2020 08:32:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/6] www: update ->preload for newer modules Date: Thu, 19 Mar 2020 03:32:51 -0500 Message-Id: <20200319083256.15593-2-e@yhbt.net> In-Reply-To: <20200319083256.15593-1-e@yhbt.net> References: <20200319083256.15593-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We'll also avoid explicitly loading standard library modules like POSIX and Digest::SHA, here; instead we load our own modules and let those load whatever non-PublicInbox:: modules they need. --- lib/PublicInbox/WWW.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 1e7d3c1e..534ee028 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -19,7 +19,6 @@ use PublicInbox::Config; use PublicInbox::Hval; use URI::Escape qw(uri_unescape); use PublicInbox::MID qw(mid_escape); -require PublicInbox::Git; use PublicInbox::GitHTTPBackend; use PublicInbox::UserContent; use PublicInbox::WwwStatic qw(r path_info_raw); @@ -136,18 +135,21 @@ sub call { # for CoW-friendliness, MOOOOO! sub preload { my ($self) = @_; + require PublicInbox::ExtMsg; require PublicInbox::Feed; require PublicInbox::View; require PublicInbox::SearchThread; require PublicInbox::MIME; - require Digest::SHA; - require POSIX; + require PublicInbox::Mbox; + require PublicInbox::ViewVCS; + require PublicInbox::WwwText; + require PublicInbox::WwwAttach; eval { require PublicInbox::Search; PublicInbox::Search::load_xapian(); }; foreach (qw(PublicInbox::SearchView - PublicInbox::Mbox IO::Compress::Gzip + PublicInbox::MboxGz PublicInbox::NewsWWW)) { eval "require $_;"; }