def DoHeartbeat(dbh, interval, connection_lifetime):
  """Update the Heartbeat table.

    Update the Heartbeat table once per <interval> for
    <connection_lifetime> seconds.

  Args:
    dbh: dbhandle to run heartbeat on.
    interval: time in (s).  Pulse frequency.
    connection_lifetime: time in (s).  Time between reconnects.
  """

  start_time = time.time()
  while time.time() < start_time + connection_lifetime:
    BeatOnce(dbh, interval)
    time.sleep(interval)
dataset/ETHPy150Open google/mysql-tools/replication_heartbeat.py/DoHeartbeat/original