lib/failover/base/decision_worker.rb
def do_decide
      active_score = 0
      passive_score = 0

      # Do some logic
      self.get_scores

      active_score = self.bucket['active'] if self.bucket['active']
      passive_score = self.bucket['passive'] if self.bucket['passive']

      if make_decision(active_score, passive_score) === false
        "Normal"
      else
        puts "Failover is happening. Log it."
      end
    end
# Make decision based on given score
Make decision based on given score
Make decision based on given score
def do_decide
      active_score = 0
      passive_score = 0
      self.get_scores
      active_score = self.bucket['active'] if self.bucket['active']
      passive_score = self.bucket['passive'] if self.bucket['passive']
      if make_decision(active_score, passive_score) === false
        "Normal"
      else
        puts "Failover is happening. Log it."
      end
    end
def do_decide active_score = 0 passive_score = 0 self . get_scores active_score = self . bucket [ 'active' ] if self . bucket [ 'active' ] passive_score = self . bucket [ 'passive' ] if self . bucket [ 'passive' ] if make_decision ( active_score , passive_score ) === false "Normal" else puts "Failover is happening. Log it." end end
Make decision based on given score
Make decision based on given score
# Do some logic