summaryrefslogtreecommitdiff
path: root/lib/oxidized/worker.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2015-09-05 12:32:37 +0300
committerSaku Ytti <saku@ytti.fi>2015-09-05 12:32:37 +0300
commitbaf19a281121cf065685f34c20978f0f2ef610af (patch)
tree959b3b4e55cbe319cc4a7bce7882fed837966ff8 /lib/oxidized/worker.rb
parentba79dea58b459eff8e2dadcffdf5a97e020c8783 (diff)
parent323f5968e3593539eca0477779114caddbfc751d (diff)
Merge branch 'feature-hook'
Diffstat (limited to 'lib/oxidized/worker.rb')
-rw-r--r--lib/oxidized/worker.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/oxidized/worker.rb b/lib/oxidized/worker.rb
index 6bb2a22..eea747e 100644
--- a/lib/oxidized/worker.rb
+++ b/lib/oxidized/worker.rb
@@ -34,12 +34,16 @@ module Oxidized
@jobs.duration job.time
node.running = false
if job.status == :success
+ Oxidized.Hooks.handle :node_success, :node => node,
+ :job => job
msg = "update #{node.name}"
msg += " from #{node.from}" if node.from
msg += " with message '#{node.msg}'" if node.msg
if node.output.new.store node.name, job.config,
:msg => msg, :user => node.user, :group => node.group
Log.info "Configuration updated for #{node.group}/#{node.name}"
+ Oxidized.Hooks.handle :post_store, :node => node,
+ :job => job
end
node.reset
else
@@ -51,6 +55,8 @@ module Oxidized
else
msg += ", retries exhausted, giving up"
node.retry = 0
+ Oxidized.Hooks.handle :node_fail, :node => node,
+ :job => job
end
Log.warn msg
end