Browse Source

verify Fixed kelp's db test

Mike Smith 11 years ago
parent
commit
91ada4c2c8
1 changed files with 7 additions and 2 deletions
  1. 7 2
      kelp/app.pl

+ 7 - 2
kelp/app.pl

@@ -18,8 +18,13 @@ get '/db' => sub {
         my $id = int rand 10000 + 1;
         my $id = int rand 10000 + 1;
         $sth->execute($id);
         $sth->execute($id);
         if ( my $row = $sth->fetchrow_hashref ) {
         if ( my $row = $sth->fetchrow_hashref ) {
-            push @response,
-              { id => $id, randomNumber => $row->{randomNumber} };
+            if ( $queries == 1 ) {
+                return { id => $id, randomNumber => $row->{randomNumber} };
+            }
+            else {
+                push @response,
+                  { id => $id, randomNumber => $row->{randomNumber} };
+            }
         }
         }
     }
     }
     return \@response;
     return \@response;