summaryrefslogtreecommitdiff
path: root/lib/oxidized/job.rb
blob: 924cd44792e04bb1b8700224dd68d950b05de5ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Oxidized
  class Job < Thread
    attr_reader :start, :end, :status, :time, :node, :config
    def initialize(node)
      @node         = node
      @start        = Time.now.utc
      super do
        Oxidized.logger.debug "lib/oxidized/job.rb: Starting fetching process for #{@node.name} at #{Time.now.utc}"
        @status, @config = @node.run
        @end             = Time.now.utc
        @time            = @end - @start
        Oxidized.logger.debug "lib/oxidized/job.rb: Config fetched for #{@node.name} at #{@end}"
      end
    end
  end
end