Skip to content

Commit

Permalink
replaces #keys with #scan_each to list runners
Browse files Browse the repository at this point in the history
  • Loading branch information
robacarp committed Jun 14, 2024
1 parent 5736c41 commit afa61c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mosquito/redis_backend.cr
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ module Mosquito

def self.list_runners : Array(String)
runner_prefix = build_key(LIST_OF_QUEUES_KEY)
Redis.instance.keys("#{runner_prefix}:*")
.map(&.as(String))
.map(&.sub(runner_prefix, ""))
keys = [] of String

Redis.instance.scan_each("#{runner_prefix}:*") do |key|
keys << key.as(String).sub(runner_prefix, "")
end

keys
end

# is this even a good idea?
Expand Down

0 comments on commit afa61c7

Please sign in to comment.