Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[ljcom] r11055: LJSUP-9747: Update admin tools

Committer: gariev
LJSUP-9747: Update admin tools
U   trunk/bin/worker/moveucluster
Modified: trunk/bin/worker/moveucluster
===================================================================
--- trunk/bin/worker/moveucluster	2011-09-30 02:21:56 UTC (rev 11054)
+++ trunk/bin/worker/moveucluster	2011-09-30 03:16:04 UTC (rev 11055)
@@ -26,15 +26,20 @@
     );
 }
 
-sub work_as_script {
-    return unless $check_tables;
+sub run {
+    my $self = shift;
 
-    foreach my $clust (@LJ::CLUSTERS) {
-        warn "checking tables on cluster $clust...\n";
-        LJ::UserManage->check_tables($clust);
+    if ($check_tables) {
+        ## just check table and exit
+        foreach my $clust (@LJ::CLUSTERS) {
+            warn "checking tables on cluster $clust...\n";
+            LJ::UserManage->check_tables($clust);
+        }
+        return 1;
+    } else {
+        ## behave like a real worker
+        $self->SUPER::run();         
     }
-
-    return 1;
 }
 
 __PACKAGE__->start;

Tags: gariev, ljcom
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