Class: S3Poller::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/s3poller/cli.rb

Instance Method Summary collapse

Instance Method Details

#pollObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/s3poller/cli.rb', line 14

def poll
  s3poller = S3Poller::Poller.new(options[:config_path], options[:local_path])
  while true
    begin
      Timeout::timeout(1800) do
        s3poller.poll
        sleep 1
      end
    rescue Timeout::Error => e
      $log.error("S3 poller did not finish within 30 minutes, #{e.message}")
    end
  end
end