Skip to content

Commit

Permalink
Merge pull request #3 from StayNTouch/CICO-56521
Browse files Browse the repository at this point in the history
CICO-56521 Reconnect if connection is not active
  • Loading branch information
Arun Murugan authored Aug 14, 2018
2 parents 1ab95a7 + 47f190f commit 7bc30da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/lhm/throttler/slave_lag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def max_current_slave_lag
end

def slave_lag(conn)
conn.reconnect! unless conn.active?

if conn.respond_to?(:exec_query)
result = conn.exec_query(SQL_SELECT_MAX_SLAVE_LAG)
result.map { |row| row['Seconds_Behind_Master'].to_i }
Expand Down

0 comments on commit 7bc30da

Please sign in to comment.