MCPcopy Create free account
hub / github.com/apecloud/myduckserver / waitForCaughtUp

Function waitForCaughtUp

pgserver/logrepl/replication_test.go:925–945  ·  view source on GitHub ↗
(r *logrepl.LogicalReplicator)

Source from the content-addressed store, hash-verified

923}
924
925func waitForCaughtUp(r *logrepl.LogicalReplicator) error {
926 log.Println("Waiting for replication to catch up")
927
928 start := time.Now()
929 for {
930 if caughtUp, err := r.CaughtUp(150); caughtUp {
931 log.Println("replication caught up")
932 break
933 } else if err != nil {
934 return err
935 }
936
937 log.Println("replication not caught up, waiting")
938 if time.Since(start) >= 30*time.Second {
939 return errors.New("Replication did not catch up")
940 }
941 time.Sleep(1 * time.Second)
942 }
943
944 return nil
945}

Callers 1

handlePseudoQueryFunction · 0.85

Calls 1

CaughtUpMethod · 0.80

Tested by

no test coverage detected