Skip to content

Commit

Permalink
Use StreamHealth from #15761
Browse files Browse the repository at this point in the history
  • Loading branch information
twthorn committed Aug 12, 2024
1 parent be6bc28 commit 4f162ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion go/vt/vttablet/sandboxconn/sandboxconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,14 @@ func (sbc *SandboxConn) SetStreamHealthResponse(res *querypb.StreamHealthRespons
sbc.streamHealthResponse = res
}

// StreamHealth always mocks a "healthy" result.
// StreamHealth always mocks a "healthy" result by default. If you want to override this behavior you
// can call SetStreamHealthResponse.
func (sbc *SandboxConn) StreamHealth(ctx context.Context, callback func(*querypb.StreamHealthResponse) error) error {
sbc.mapMu.Lock()
defer sbc.mapMu.Unlock()
if sbc.streamHealthResponse != nil {
return callback(sbc.streamHealthResponse)
}
return nil
}

Expand Down

0 comments on commit 4f162ce

Please sign in to comment.