Skip cache invalidation on failed connection (#3033)
parent
33d592deb4
commit
30291081f4
|
|
@ -545,6 +545,12 @@ func (a *APIClient) SwitchContext(name string) error {
|
|||
if err := a.config.SwitchContext(name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !a.CheckConnectivity() {
|
||||
log.Debug().Msg("No connectivity, skipping cache invalidation")
|
||||
} else if err := a.invalidateCache(); err != nil {
|
||||
return err
|
||||
}
|
||||
a.reset()
|
||||
ResetMetrics()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue