mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
add reconnect duration allows for verifying disconnect intervals (#15306)
This commit is contained in:
parent
4aecd8d039
commit
785b429737
@ -242,8 +242,10 @@ func (c *Client) MarkOffline() bool {
|
||||
}
|
||||
if c.HealthCheckFn() {
|
||||
if atomic.CompareAndSwapInt32(&c.connected, offline, online) {
|
||||
logger.Info("Client %s online", c.url.String())
|
||||
atomic.StoreInt64(&c.lastConn, time.Now().UnixNano())
|
||||
now := time.Now()
|
||||
disconnected := now.Sub(c.LastConn())
|
||||
logger.Info("Client '%s' re-connected in %s", c.url.String(), disconnected)
|
||||
atomic.StoreInt64(&c.lastConn, now.UnixNano())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user