Class: S3Poller::Poller

Inherits:
Object
  • Object
show all
Defined in:
lib/s3poller/poller.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_path, local_path) ⇒ Poller

Returns a new instance of Poller.



8
9
10
11
# File 'lib/s3poller/poller.rb', line 8

def initialize(config_path, local_path)
  @local_path = local_path
  @aws_config = YAML::load(File.open(config_path))
end

Instance Method Details

#pollObject



13
14
15
16
17
18
19
20
21
# File 'lib/s3poller/poller.rb', line 13

def poll
  begin
    files_to_download.each do |file| 
      downloader.download(file)
    end
  rescue Exception => e
    $log.error("Failed to poll #{e.message}")
  end
end