lib/sensu/api/routes/silenced.rb
def fetch_silenced(silenced_keys=[])
          entries = []
          unless silenced_keys.empty?
            @redis.mget(*silenced_keys) do |silenced|
              silenced_keys.each_with_index do |silenced_key, silenced_index|
                if silenced[silenced_index]
                  silenced_info = Sensu::JSON.load(silenced[silenced_index])
                  @redis.ttl(silenced_key) do |ttl|
                    silenced_info[:expire] = ttl
                    entries << silenced_info
                    if silenced_index == silenced_keys.length - 1
                      yield(entries)
                    end
                  end
                else
                  @redis.srem("silenced", silenced_key)
                  if silenced_index == silenced_keys.length - 1
                    @redis.ping do
                      yield(entries)
                    end
                  end
                end
              end
            end
          else
            yield(entries)
          end
        end
# Fetch silenced registry entries for the provided silenced
# entry keys.
#
# @param silenced_keys [Array]
# @yield callback [entries] callback/block called after the
#   silenced registry entries have been fetched.
Fetch silenced registry entries for the provided silenced
entry keys.
Fetch silenced registry entries for the provided silenced entry keys .
def fetch_silenced(silenced_keys=[])
          entries = []
          unless silenced_keys.empty?
            @redis.mget(*silenced_keys) do |silenced|
              silenced_keys.each_with_index do |silenced_key, silenced_index|
                if silenced[silenced_index]
                  silenced_info = Sensu::JSON.load(silenced[silenced_index])
                  @redis.ttl(silenced_key) do |ttl|
                    silenced_info[:expire] = ttl
                    entries << silenced_info
                    if silenced_index == silenced_keys.length - 1
                      yield(entries)
                    end
                  end
                else
                  @redis.srem("silenced", silenced_key)
                  if silenced_index == silenced_keys.length - 1
                    @redis.ping do
                      yield(entries)
                    end
                  end
                end
              end
            end
          else
            yield(entries)
          end
        end
def fetch_silenced ( silenced_keys = [ ] ) entries = [ ] unless silenced_keys . empty? @redis . mget ( * silenced_keys ) do | silenced | silenced_keys . each_with_index do | silenced_key , silenced_index | if silenced [ silenced_index ] silenced_info = Sensu :: JSON . load ( silenced [ silenced_index ] ) @redis . ttl ( silenced_key ) do | ttl | silenced_info [ :expire ] = ttl entries << silenced_info if silenced_index == silenced_keys . length - 1 yield ( entries ) end end else @redis . srem ( "silenced" , silenced_key ) if silenced_index == silenced_keys . length - 1 @redis . ping do yield ( entries ) end end end end end else yield ( entries ) end end
Fetch silenced registry entries for the provided silenced
entry keys.
Fetch silenced registry entries for the provided silenced entry keys .
silenced_keys
None
]
callback  callback/block called after the silenced registry entries have been fetched.
callback callback / block called after the silenced registry entries have been fetched .