MCPcopy Index your code
hub / github.com/google/seesaw / close

Method close

engine/sync.go:391–407  ·  view source on GitHub ↗

close closes an existing connection to our peer Seesaw node.

()

Source from the content-addressed store, hash-verified

389
390// close closes an existing connection to our peer Seesaw node.
391func (sc *syncClient) close() error {
392 sc.lock.Lock()
393 defer sc.lock.Unlock()
394 if sc.client == nil {
395 return nil
396 }
397 sc.refs--
398 if sc.refs > 0 {
399 return nil
400 }
401 if err := sc.client.Close(); err != nil {
402 sc.client = nil
403 return fmt.Errorf("client close failed: %v", err)
404 }
405 sc.client = nil
406 return nil
407}
408
409// failover requests that the peer node initiate a failover.
410func (sc *syncClient) failover() error {

Callers 2

failoverMethod · 0.95
runOnceMethod · 0.95

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected