MCPcopy Create free account
hub / github.com/dolthub/doltgresql / waitForCaughtUp

Function waitForCaughtUp

testing/go/replication_test.go:765–785  ·  view source on GitHub ↗
(r *logrepl.LogicalReplicator)

Source from the content-addressed store, hash-verified

763}
764
765func waitForCaughtUp(r *logrepl.LogicalReplicator) error {
766 log.Println("Waiting for replication to catch up")
767
768 start := time.Now()
769 for {
770 if caughtUp, err := r.CaughtUp(150); caughtUp {
771 log.Println("replication caught up")
772 break
773 } else if err != nil {
774 return err
775 }
776
777 log.Println("replication not caught up, waiting")
778 if time.Since(start) >= 2*time.Second {
779 return errors.New("Replication did not catch up")
780 }
781 time.Sleep(20 * time.Millisecond)
782 }
783
784 return nil
785}

Callers 1

handlePseudoQueryFunction · 0.85

Calls 1

CaughtUpMethod · 0.80

Tested by

no test coverage detected