MCPcopy
hub / github.com/bradfitz/gomemcache / condRelease

Method condRelease

memcache/memcache.go:207–213  ·  view source on GitHub ↗

condRelease releases this connection if the error pointed to by err is nil (not an error) or is only a protocol level error (e.g. a cache miss). The purpose is to not recycle TCP connections that are bad.

(err *error)

Source from the content-addressed store, hash-verified

205// cache miss). The purpose is to not recycle TCP connections that
206// are bad.
207func (cn *conn) condRelease(err *error) {
208 if *err == nil || resumableError(*err) {
209 cn.release()
210 } else {
211 cn.nc.Close()
212 }
213}
214
215func (c *Client) putFreeConn(addr net.Addr, cn *conn) {
216 c.mu.Lock()

Callers 2

onItemMethod · 0.80
withAddrRwMethod · 0.80

Calls 3

releaseMethod · 0.95
resumableErrorFunction · 0.85
CloseMethod · 0.80

Tested by

no test coverage detected