Class: Oxidized::Job
- Inherits:
-
Thread
- Object
- Thread
- Oxidized::Job
- Defined in:
- lib/oxidized/job.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#end ⇒ Object
readonly
Returns the value of attribute end.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(node) ⇒ Job
constructor
A new instance of Job.
Constructor Details
#initialize(node) ⇒ Job
Returns a new instance of Job.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/oxidized/job.rb', line 4 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 |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/oxidized/job.rb', line 3 def config @config end |
#end ⇒ Object (readonly)
Returns the value of attribute end.
3 4 5 |
# File 'lib/oxidized/job.rb', line 3 def end @end end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
3 4 5 |
# File 'lib/oxidized/job.rb', line 3 def node @node end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
3 4 5 |
# File 'lib/oxidized/job.rb', line 3 def start @start end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/oxidized/job.rb', line 3 def status @status end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
3 4 5 |
# File 'lib/oxidized/job.rb', line 3 def time @time end |