lib/logstash/inputs/jdbc.rb in logstash-input-jdbc-1.0.2 vs lib/logstash/inputs/jdbc.rb in logstash-input-jdbc-2.0.1

- old
+ new

@@ -157,29 +157,30 @@ @statement = File.read(@statement_filepath) if @statement_filepath end # def register def run(queue) if @schedule - @scheduler = Rufus::Scheduler.new(:max_work_threads => 1) + @scheduler = Rufus::Scheduler.new @scheduler.cron @schedule do execute_query(queue) end + @scheduler.join else execute_query(queue) end end # def run - def teardown + def stop @scheduler.stop if @scheduler # update state file for next run if @record_last_run File.write(@last_run_metadata_path, YAML.dump(@sql_last_start)) end close_jdbc_connection - end # def teardown + end private def execute_query(queue) # update default parameters