]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: add News* wrappers to preload
authorEric Wong <e@80x24.org>
Fri, 26 Feb 2016 03:44:23 +0000 (03:44 +0000)
committerEric Wong <e@80x24.org>
Fri, 26 Feb 2016 03:44:23 +0000 (03:44 +0000)
We want to preload as much as possible in -httpd when forking
to save memory via CoW.

lib/PublicInbox/WWW.pm

index fd09280390f831067b5cec748e47dd704214823d..2da819b18e698753fa73b1297d510af7d263f2ae 100644 (file)
@@ -94,12 +94,11 @@ sub preload {
        require Digest::SHA;
        require POSIX;
 
-       eval {
-               require PublicInbox::Search;
-               require PublicInbox::SearchView;
-               require PublicInbox::Mbox;
-               require IO::Compress::Gzip;
-       };
+       foreach (qw(PublicInbox::Search PublicInbox::SearchView
+                       PublicInbox::Mbox IO::Compress::Gzip
+                       PublicInbox::NewsWWW PublicInbox::NewsGroup)) {
+               eval "require $_;";
+       }
 }
 
 # private functions below