diff --git a/README.md b/README.md
index 36e82911..976cf1c9 100644
--- a/README.md
+++ b/README.md
@@ -176,7 +176,7 @@ To make the library both flexible and fast, we had to integrate the reflection A
## Proxy Client / DBAAS
-To compile the client for the proxy server in out database as a service environment, pass `-tags as_proxy` to the compiler on build.
+To compile the client for the proxy server in our database-as-a-service (dbaas) environment, pass `-tags as_proxy` to the compiler on build.
## License
diff --git a/proxy_auth_interceptor.go b/proxy_auth_interceptor.go
index 788d7386..54124339 100644
--- a/proxy_auth_interceptor.go
+++ b/proxy_auth_interceptor.go
@@ -92,11 +92,13 @@ func (interceptor *authInterceptor) tokenRefresher() {
// provide 5 secs of buffer before expiry due to network latency
wait := interceptor.expiry.Sub(time.Now()) - 5*time.Second
+ ticker := time.NewTicker(wait)
+ // defer ticker.Close()
+
for {
- ticker := time.NewTicker(wait)
+ ticker.Reset(wait)
select {
case <-ticker.C:
- ticker.Stop() // prevent goroutine leak
err := interceptor.refreshToken()
if err != nil {
wait = time.Second
@@ -105,7 +107,6 @@ func (interceptor *authInterceptor) tokenRefresher() {
}
case <-interceptor.closer:
- ticker.Stop() // prevent goroutine leak
// channel closed; return from the goroutine
return
}