lib/logstash/outputs/gemfire.rb in logstash-output-gemfire-0.1.4 vs lib/logstash/outputs/gemfire.rb in logstash-output-gemfire-2.0.0
- old
+ new
@@ -59,18 +59,14 @@
set("name", @cache_name).
set("cache-xml-file", @cache_xml_file).create
@logger.debug("Created cache #{@cache.inspect}")
rescue => e
- if terminating?
- return
- else
- @logger.error("Gemfire connection error (during connect), will reconnect",
- :exception => e, :backtrace => e.backtrace)
- sleep(1)
- retry
- end
+ @logger.error("Gemfire connection error (during connect), will reconnect",
+ :exception => e, :backtrace => e.backtrace)
+ Stud.stoppable_sleep(1) { stop? }
+ retry if !stop?
end
@region = @cache.getRegion(@region_name);
@logger.debug("Created region #{@region.inspect}")
end # def connect
@@ -93,11 +89,10 @@
def to_s
return "gemfire://#{cache_name}"
end
public
- def teardown
+ def close
@cache.close if @cache
@cache = nil
- finished
- end # def teardown
+ end # def close
end # class LogStash::Outputs::Gemfire