mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Merge pull request #434 from sr-ix/master
Remove extra 'end' from Redis output
This commit is contained in:
commit
1a4d8ed97b
1 changed files with 4 additions and 5 deletions
|
@ -165,12 +165,11 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
|||
def congestion_check(key)
|
||||
return if @congestion_threshold == 0
|
||||
if (Time.now.to_i - @congestion_check_times[key]) >= @congestion_interval # Check congestion only if enough time has passed since last check.
|
||||
@congestion_check_time = Time.now.to_i
|
||||
while @redis.llen(key) > @congestion_threshold # Don't push event to redis key which has reached @congestion_threshold.
|
||||
@logger.warn? and @logger.warn("Redis key size has hit a congestion threshold #{@congestion_threshold} suspending output for #{@congestion_interval} seconds")
|
||||
sleep @congestion_interval
|
||||
end
|
||||
while @redis.llen(key) > @congestion_threshold # Don't push event to redis key which has reached @congestion_threshold.
|
||||
@logger.warn? and @logger.warn("Redis key size has hit a congestion threshold #{@congestion_threshold} suspending output for #{@congestion_interval} seconds")
|
||||
sleep @congestion_interval
|
||||
end
|
||||
@congestion_check_time = Time.now.to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue