Skip to content

Commit

Permalink
Added check to ensure SD last-good stash is checked for nil before re…
Browse files Browse the repository at this point in the history
…turning
  • Loading branch information
lonelycode committed Jan 10, 2017
1 parent 26dba93 commit a20f619
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tyk_reverse_proxy_clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"strconv"
"strings"
"sync"
"errors"
"time"
"github.com/TykTechnologies/tykcommon"

Expand All @@ -41,6 +42,12 @@ func GetURLFromService(spec *APISpec) (*tykcommon.HostList, error) {
spec.HasRun = true
spec.ServiceRefreshInProgress = false
log.Warning("[PROXY][SD] Service Discovery returned empty host list! Returning last good set.")

if spec.LastGoodHostList == nil {
log.Warning("[PROXY][SD] Last good host list is nil, returning empty set.")
spec.LastGoodHostList = tykcommon.NewHostList()
}

return spec.LastGoodHostList, nil
}

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package main
var VERSION string = "v2.3.0.46"
var VERSION string = "v2.3.0.47"

0 comments on commit a20f619

Please sign in to comment.