lib/redis/stream/client.rb
#remove dead and non existing consumers and groups
remove dead and non existing consumers and groups
remove dead and non existing consumers and groups
def sanitize
        groups.each do |group|
          consumers(group["name"]).each do |consumer|
            if @consumer_id != consumer["name"]
              result = sync_add({}, "to" => consumer["name"], "group" => group["name"], "type" => Redis::Stream::Type::PING, "time_out" => 1)
              if result.nil?
                del_consumer(group['name'], consumer['name'])
              end
            end
          end
        end
      end
def sanitize groups . each do | group | consumers ( group [ "name" ] ) . each do | consumer | if @consumer_id != consumer [ "name" ] result = sync_add ( { } , "to" => consumer [ "name" ] , "group" => group [ "name" ] , "type" => Redis :: Stream :: Type :: PING , "time_out" => 1 ) if result . nil? del_consumer ( group [ 'name' ] , consumer [ 'name' ] ) end end end end end
remove dead and non existing consumers and groups
remove dead and non existing consumers and groups