Changeset 824
- Timestamp:
- 02/08/02 20:08:44 (11 years ago)
- Files:
-
- 1 modified
-
trunk/bin/qbufferd.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/qbufferd.pl
r752 r824 66 66 # do main cluster updates 67 67 my $dbh = LJ::get_dbh("master"); 68 my $sth = $dbh->prepare("SELECT tablename, COUNT(*) FROM querybuffer GROUP BY 1"); 69 $sth->execute; 70 my @tables; 71 while (my ($table, $count) = $sth->fetchrow_array) { 72 push @tables, $table; 68 if ($dbh) { 69 my $sth = $dbh->prepare("SELECT tablename, COUNT(*) FROM querybuffer GROUP BY 1"); 70 $sth->execute; 71 my @tables; 72 while (my ($table, $count) = $sth->fetchrow_array) { 73 push @tables, $table; 74 } 75 foreach my $table (@tables) { 76 my $count = LJ::query_buffer_flush($dbh, $table); 77 } 73 78 } 74 foreach my $table (@tables) { 75 my $count = LJ::query_buffer_flush($dbh, $table); 76 } 77 79 78 80 # handle clusters 79 81 foreach my $c (@LJ::CLUSTERS) { 80 82 my $db = LJ::get_cluster_master($c); 83 next unless $db; 81 84 82 85 my $sth = $db->prepare("SELECT cmd, COUNT(*) FROM cmdbuffer GROUP BY 1");
