Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- queue="resque:queue:notifications"
- # Replace with location pertinent to your setup.
- cd ~/src/digistore_new/administrators
- had=`redis-cli llen $queue |sed 's/\([0-9]\+\)/$1/'`
- # TODO: There must be a way to do this in one operation.
- redis-cli ltrim $queue 0 0 >/dev/null
- redis-cli lpop $queue >/dev/null
- # Check for errors.
- now=`redis-cli llen $queue |sed 's/\([0-9]\+\)/$1/'`
- if [ "$now" != '0' ]
- then
- 2>&1 echo "Unable to empty queue $queue: ($now elements)"
- 2>&1 redis-cli lrange $queue 0 25
- exit 1
- fi
Add Comment
Please, Sign In to add comment