-
-
Save artofhuman/0313ca17c775a8756376 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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