Remove obsolete config $LJ::S2COMPILED_MIGRATION_DONE.

        Patch by kareila. 

diffs (83 lines):

diff -r c8378da9fbb6 -r 075727259777 cgi-bin/LJ/ConfCheck/General.pm
--- a/cgi-bin/LJ/ConfCheck/General.pm   Thu Apr 29 01:42:14 2010 -0700
+++ b/cgi-bin/LJ/ConfCheck/General.pm   Thu Apr 29 05:07:18 2010 -0500
@@ -792,7 +792,6 @@ my %bools = (
              'STATS_FORCE_SLOW' => "Make all stats hit the 'slow' database 
role, never using 'slave' or 'master'",
              'SERVER_DOWN' => "The site is globally marked as 'down' and users 
get an error message, as defined by \$SERVER_DOWN_MESSAGE and 
\$SERVER_DOWN_SUBJECT.  It's not clear why this should ever be used instead of 
\$SERVER_TOTALLY_DOWN",
              'SERVER_TOTALLY_DOWN' => "The site is globally marked as 'down' 
and users get an error message, as defined by \$SERVER_DOWN_MESSAGE and 
\$SERVER_DOWN_SUBJECT.  But compared to \$SERVER_DOWN, this error message is 
done incredibly early before any dispatch to different modules.",
-             'S2COMPILED_MIGRATION_DONE' => "Don't try to load compiled S2 
layers from the global cluster.  Any new installation can enable this safely as 
a minor optimization.  The option only really makes sense for large, old 
sites.",
              "S1_SHORTCOMINGS" => "Use the S2 style named 's1shortcomings' to 
handle page types that S1 can't handle.  Otherwise, BML is used.  This is off 
by defalut, but will eventually become on by default, and no longer an option.",
              "REQUIRE_TALKHASH" => "Require submitted comments to include a 
signed hidden value provided by the server.  Slows down comment-spammers, at 
least, in that they have to fetch pages first, instead of just blasting away 
POSTs.  Defaults to off.",
              "REQUIRE_TALKHASH_NOTOLD" => "If \$REQUIRE_TALKHASH is on, also 
make sure that the talkhash provided was issued in the past two hours.  
Defaults to off.",
diff -r c8378da9fbb6 -r 075727259777 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm  Thu Apr 29 01:42:14 2010 -0700
+++ b/cgi-bin/LJ/S2.pm  Thu Apr 29 05:07:18 2010 -0500
@@ -427,9 +427,7 @@ sub load_layers {
         }
     }
 
-    # now we have to go through everything again and verify they're all loaded 
and
-    # otherwise do a fallback to the global
-    my @to_load;
+    # now we have to go through everything again and verify they're all loaded
     foreach my $lid (@from_db) {
         next if S2::layer_loaded($lid);
 
@@ -443,27 +441,9 @@ sub load_layers {
             next;
         }
 
-        if ($LJ::S2COMPILED_MIGRATION_DONE) {
-            LJ::MemCache::set([ $lid, "s2c:$lid" ], [ time(), 0 ]);
-            next;
-        }
-
-        push @to_load, $lid;
-    }
-    return $maxtime unless @to_load;
-
-    # get the dbh and start loading these
-    my $dbr = LJ::S2::get_s2_reader();
-    die "Failure getting S2 database handle in LJ::S2::load_layers\n"
-        unless $dbr;
-
-    my $where = join(' OR ', map { "s2lid=$_" } @to_load);
-    my $sth = $dbr->prepare("SELECT s2lid, compdata, comptime FROM s2compiled 
WHERE $where");
-    $sth->execute;
-    while (my ($id, $comp, $comptime) = $sth->fetchrow_array) {
-        S2::load_layer($id, $comp, $comptime);
-        $maxtime = $comptime if $comptime > $maxtime;
-    }
+        LJ::MemCache::set( [ $lid, "s2c:$lid" ], [ time(), 0 ] );
+    }
+
     return $maxtime;
 }
 
diff -r c8378da9fbb6 -r 075727259777 cgi-bin/ljdefaults.pl
--- a/cgi-bin/ljdefaults.pl     Thu Apr 29 01:42:14 2010 -0700
+++ b/cgi-bin/ljdefaults.pl     Thu Apr 29 05:07:18 2010 -0500
@@ -200,7 +200,6 @@
 
     # maximum size to cache s2compiled data
     $MAX_S2COMPILED_CACHE_SIZE ||= 7500; # bytes
-    $S2COMPILED_MIGRATION_DONE ||= 0;    # turn on after s2compiled2 migration
 
     # max content length we should read via ATOM api
     # 25MB
diff -r c8378da9fbb6 -r 075727259777 etc/config.pl
--- a/etc/config.pl     Thu Apr 29 01:42:14 2010 -0700
+++ b/etc/config.pl     Thu Apr 29 05:07:18 2010 -0500
@@ -803,12 +803,6 @@
                            # that they must be public styles
     );
 
-    # this is on in the default file here because most of the time you
-    # want this flag to be on.  if you have an existing site and you're
-    # copying this file, make sure to only turn this flag on if you've
-    # actually migrated everything.
-    $S2COMPILED_MIGRATION_DONE = 1;
-
     # optional LDAP support
     # required:
     #    $LJ::LDAP_HOST = "ldap.example.com";  # anything that the Net::LDAP 
constructor takes
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to