code: func (l *Ledis) WaitReplication() error {
  	if !l.ReplicationUsed() {
  		return ErrRplNotSupport
  
  	}
  
  	for i := 0; i < 100; i++ {
  		l.noticeReplication()
  
  		select {
  		case <-l.rDoneCh:
  		case <-l.quit:
  			return nil
  		}
  		time.Sleep(100 * time.Millisecond)
  
  		b, err := l.r.CommitIDBehind()
  		if err != nil {
  			return err
  		} else if !b {
  			return nil
  		}
  	}
  
  	return errors.New("wait replication too many times")
  }
docs: // WaitReplication waits replication done