summaryrefslogtreecommitdiff
path: root/lib/oxidized/worker.rb
diff options
context:
space:
mode:
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