about summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-04-14 11:00:14 +0200
committerfranck cuny <franck@lumberjaph.net>2010-04-14 11:00:14 +0200
commitd45bef14461416aab0628cce8bea300c09d1d7bf (patch)
tree1f577914872361a4e89e01d1012b2343111907fa
parentfix: del, not delete (diff)
downloadpresque-d45bef14461416aab0628cce8bea300c09d1d7bf.tar.gz
check if queue_name is given
-rw-r--r--lib/presque/JobQueueHandler.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/presque/JobQueueHandler.pm b/lib/presque/JobQueueHandler.pm
index 17a1e8a..2729f07 100644
--- a/lib/presque/JobQueueHandler.pm
+++ b/lib/presque/JobQueueHandler.pm
@@ -6,7 +6,15 @@ __PACKAGE__->asynchronous(1);
 
 sub get {
     my ( $self, $queue_name ) = @_;
+
+    if (!$queue_name) {
+        $self->response->code(404);
+        $self->response->body("queue name is missing");
+        return;
+    }
+
     my $key = $queue_name . ':queue';
+
     $self->application->redis->lrange(
         $key, 0, 9,
         sub {
@@ -46,6 +54,8 @@ presque::IndexHandler - a redis based message queue
 
 =head1 DESCRIPTION
 
+Return some informations about a queue.
+
 =head1 AUTHOR
 
 franck cuny E<lt>franck@lumberjaph.netE<gt>