lib/dumper/agent.rb in dumper-1.0.0 vs lib/dumper/agent.rb in dumper-1.0.1
- old
+ new
@@ -67,12 +67,14 @@
json = api_request('agent/poll', :params => { :token => @token })
if json[:status] == 'ok'
# Promoted or demoted?
if json[:token]
- @token = json[:token] # promote
+ log 'promoted to primary' if @token.nil?
+ @token = json[:token]
else
- @token = nil # demote
+ log 'demoted to secondary' if @token
+ @token = nil
end
if json[:job]
if pid = fork
# Parent