Commit e332c8d8 authored by Matthias Lechner's avatar Matthias Lechner Committed by Yong Tang

Fix error handling when query fails (#2255)

parent d42e0d45
...@@ -77,6 +77,12 @@ func (l *Loop) inc() { ...@@ -77,6 +77,12 @@ func (l *Loop) inc() {
l.i++ l.i++
} }
func (l *Loop) reset() {
l.Lock()
defer l.Unlock()
l.i = 0
}
func (l *Loop) setDisabled() { func (l *Loop) setDisabled() {
l.Lock() l.Lock()
defer l.Unlock() defer l.Unlock()
......
...@@ -42,6 +42,7 @@ func setup(c *caddy.Controller) error { ...@@ -42,6 +42,7 @@ func setup(c *caddy.Controller) error {
for time.Now().Before(deadline) { for time.Now().Before(deadline) {
if _, err := l.exchange(addr); err != nil { if _, err := l.exchange(addr); err != nil {
l.reset()
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
continue continue
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment