Skip to content

Instantly share code, notes, and snippets.

@sclinede
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save sclinede/8affb4ffa6713e7113f8 to your computer and use it in GitHub Desktop.

Select an option

Save sclinede/8affb4ffa6713e7113f8 to your computer and use it in GitHub Desktop.
Clear BgExecutor queue by job name
bgkey = 'pc4_production:bg_executor:jobs_queue'
result = []
($redis.llen bgkey).times { |idx| result << ($redis.lindex bgkey, idx) if ($redis.lindex bgkey, idx).include?('map_coord') }
($redis.llen bgkey).times { |idx| val = ($redis.lindex bgkey, idx); $redis.lrem bgkey, 0, val if val.include?('map_coord') }
($redis.llen bgkey).times { |idx| val = ($redis.lindex bgkey, idx).to_s; result << val if val.include?('map_coord') }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment