Fixing some cosmetic issues and a potential race condition.
This commit is contained in:
parent
bb5408f5e2
commit
f196aa9ed7
3 changed files with 6 additions and 5 deletions
|
@ -503,11 +503,12 @@ func basicAuth(username, password string) string {
|
|||
func (r *realisClient) ReestablishConn() error {
|
||||
// Close existing connection
|
||||
r.logger.Println("Re-establishing Connection to Aurora")
|
||||
r.Close()
|
||||
|
||||
r.lock.Lock()
|
||||
defer r.lock.Unlock()
|
||||
|
||||
r.Close()
|
||||
|
||||
// Recreate connection from scratch using original options
|
||||
newRealis, err := NewRealisClient(r.config.options...)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue