Permalink
Browse files

fix for case if namespace is not used

  • Loading branch information...
1 parent 3077835 commit 6514253a6dfcf925260d6e3558aac30095affe16 @itgod itgod committed Sep 13, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 check_sidekiq_queue
View
@@ -97,11 +97,15 @@ if [ ! -z "$PASS" ]; then
PASS="-a $PASS"
fi
+if [ ! -z "$NAMESPACE" ]; then
+ NAMESPACE="$NAMESPACE:"
+fi
+
if [ -n "$SYSTEM" ]; then
- QUEUE_SIZE=`redis-cli -h $HOST $PASS -n $DB zcard $NAMESPACE:$SYSTEM 2>$ERR | cut -d " " -f 1`
+ QUEUE_SIZE=`redis-cli -h $HOST $PASS -n $DB zcard ${NAMESPACE}$SYSTEM 2>$ERR | cut -d " " -f 1`
QUEUE=$SYSTEM
else
- QUEUE_SIZE=`redis-cli -h $HOST $PASS -n $DB llen $NAMESPACE:queue:$QUEUE 2>$ERR | cut -d " " -f 1`
+ QUEUE_SIZE=`redis-cli -h $HOST $PASS -n $DB llen ${NAMESPACE}queue:$QUEUE 2>$ERR | cut -d " " -f 1`
fi
if [ -s "$ERR" ]; then

0 comments on commit 6514253

Please sign in to comment.