]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WWW.pm
www: avoid BEGIN block for config loading
[public-inbox.git] / lib / PublicInbox / WWW.pm
index a01271b1c9291460a86f8011470e83f4ad770ac9..e6eec3d60ed567d974c300819bff37eb6e1aba62 100644 (file)
@@ -17,12 +17,10 @@ use constant SSOMA_URL => 'http://ssoma.public-inbox.org/';
 use constant PI_URL => 'http://public-inbox.org/';
 our $LISTNAME_RE = qr!\A/([\w\.\-]+)!;
 our $pi_config;
-BEGIN {
-       $pi_config = PublicInbox::Config->new;
-}
 
 sub run {
        my ($cgi, $method) = @_;
+       $pi_config ||= PublicInbox::Config->new;
        my %ctx = (cgi => $cgi, pi_config => $pi_config);
        if ($method !~ /\AGET|HEAD\z/) {
                return r(405, 'Method Not Allowed');