mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -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 c.HealthCheckFn() {
|
||||||
if atomic.CompareAndSwapInt32(&c.connected, offline, online) {
|
if atomic.CompareAndSwapInt32(&c.connected, offline, online) {
|
||||||
logger.Info("Client %s online", c.url.String())
|
now := time.Now()
|
||||||
atomic.StoreInt64(&c.lastConn, time.Now().UnixNano())
|
disconnected := now.Sub(c.LastConn())
|
||||||
|
logger.Info("Client '%s' re-connected in %s", c.url.String(), disconnected)
|
||||||
|
atomic.StoreInt64(&c.lastConn, now.UnixNano())
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user