vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r17945: LJSUP-7635: clean friendstimes db cache

Committer: vad
LJSUP-7635: clean friendstimes db cache
U   trunk/bin/maint/clean_caches.pl
Modified: trunk/bin/maint/clean_caches.pl
===================================================================
--- trunk/bin/maint/clean_caches.pl	2010-12-16 09:51:54 UTC (rev 17944)
+++ trunk/bin/maint/clean_caches.pl	2010-12-16 11:36:02 UTC (rev 17945)
@@ -25,18 +25,6 @@
         $dbh->do("DELETE FROM underage WHERE timeof < (UNIX_TIMESTAMP() - 86400*90) LIMIT 2000");
     }
 
-    print "-I- Cleaning friendstimes.\n";
-    foreach my $c (@LJ::CLUSTERS) {
-        my $dbcm = LJ::get_cluster_master($c);
-        $dbcm->do("DELETE FROM friendstimes WHERE added < UNIX_TIMESTAMP() - 86400*7 LIMIT 100000");
-    }
-
-    print "-I- Cleaning comet_history.\n";
-    foreach my $c (@LJ::CLUSTERS) {
-        my $dbcm = LJ::get_cluster_master($c);
-        $dbcm->do("DELETE FROM comet_history WHERE added < UNIX_TIMESTAMP() - 86400*10 LIMIT 100000");
-    }
-
     print "-I- Cleaning captcha sessions.\n";
     foreach my $c (@LJ::CLUSTERS) {
         my $dbcm = LJ::get_cluster_master($c);
@@ -194,6 +182,24 @@
     print "    deleted $cnt_delete\n";
 
     LJ::run_hooks('extra_cache_clean');
+    LJ::disconnect_dbs();
+
+    print "-I- Cleaning friendstimes.\n";
+    foreach my $c (@LJ::CLUSTERS) {
+        warn "        cleand cluster $c";
+        my $dbcm = LJ::get_cluster_master($c);
+        $dbcm->do("DELETE FROM friendstimes WHERE added < UNIX_TIMESTAMP() - 86400*7 LIMIT 100000");
+        warn "            done";
+    }
+    LJ::disconnect_dbs();
+
+    print "-I- Cleaning comet_history.\n";
+    foreach my $c (@LJ::CLUSTERS) {
+        my $dbcm = LJ::get_cluster_master($c);
+        $dbcm->do("DELETE FROM comet_history WHERE added < UNIX_TIMESTAMP() - 86400*10 LIMIT 100000");
+    }
+    LJ::disconnect_dbs();
+
 };
 
 1;

Tags: livejournal, pl, vadvs
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments