MCPcopy
hub / github.com/redis/go-redis / retireMaintNotificationsConns

Method retireMaintNotificationsConns

maintnotifications/manager.go:285–299  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

283}
284
285func (hm *Manager) retireMaintNotificationsConns(ctx context.Context) {
286 conns := hm.maintNotificationsConnSnapshot()
287 if len(conns) == 0 || hm.pool == nil {
288 return
289 }
290
291 if retirer, ok := hm.pool.(pool.ConnRetirer); ok {
292 retirer.RetireConns(ctx, conns, pool.CloseReasonMaintNotificationsDisabled)
293 return
294 }
295
296 for _, cn := range conns {
297 _ = hm.pool.CloseConn(ctx, cn, pool.CloseReasonMaintNotificationsDisabled, pool.MetricStateIdle)
298 }
299}
300
301// Close closes the manager.
302func (hm *Manager) Close() error {

Callers 1

CloseMethod · 0.95

Calls 3

RetireConnsMethod · 0.65
CloseConnMethod · 0.65

Tested by

no test coverage detected