// collectHeartbeat reads the latest changelog heartbeat value
collectHeartbeat reads the latest changelog heartbeat value
// collectHeartbeat reads the latest changelog heartbeat value
func (this *Throttler) collectHeartbeat() {
	ticker := time.Tick(time.Duration(this.migrationContext.HeartbeatIntervalMilliseconds) * time.Millisecond)
	for range ticker {
		go func() error {
			if atomic.LoadInt64(&this.migrationContext.CleanupImminentFlag) > 0 {
				return nil
			}
			changelogState, err := this.inspector.readChangelogState()
			if err != nil {
				return log.Errore(err)
			}
			if heartbeatValue, ok := changelogState["heartbeat"]; ok {
				this.parseChangelogHeartbeat(heartbeatValue)
			}
			return nil
		}()
	}
}
func ( this * Throttler ) collectHeartbeat ( ) { ticker := time . Tick ( time . Duration ( this . migrationContext . HeartbeatIntervalMilliseconds ) * time . Millisecond ) for range ticker { go func ( ) error { if atomic . LoadInt64 ( & this . migrationContext . CleanupImminentFlag ) > 0 { return nil } changelogState , err := this . inspector . readChangelogState ( ) if err != nil { return log . Errore ( err ) } if heartbeatValue , ok := changelogState [ " " ] ; ok { this . parseChangelogHeartbeat ( heartbeatValue ) } return nil } ( ) } }
collectHeartbeat reads the latest changelog heartbeat value
collectHeartbeat reads the latest changelog heartbeat value