Skip to content

Instantly share code, notes, and snippets.

@artofhuman
Forked from sclinede/bge_clear_queue.rb
Last active August 29, 2015 14:14
Show Gist options
  • Save artofhuman/0313ca17c775a8756376 to your computer and use it in GitHub Desktop.
Save artofhuman/0313ca17c775a8756376 to your computer and use it in GitHub Desktop.
bgkey = ::BgExecutor::Configuration[:redis][:namespace] + ':bg_executor:jobs_queue'
job_name = 'map_coord'
# Test:
result = []
($redis.llen bgkey).times { |idx| val = ($redis.lindex bgkey, idx).to_s; result << val if val.include?(job_name) }
# And Run:
# ($redis.llen bgkey).times { |idx| val = ($redis.lindex bgkey, idx); $redis.lrem bgkey, 0, val if val.include?(job_name) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment