Committer: gariev
LJSUP-9747: Update admin toolsU 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;