Skip to content

Commit

Permalink
apidef: clean up the last two error names
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan authored and lonelycode committed Mar 2, 2017
1 parent 092f594 commit fb329e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions apidef/api_definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,13 @@ func (a *APIDefinition) EncodeForDB() {
}

a.VersionData.Versions = new_version
// log.Warning(a.VersionData.Versions)
}

func (a *APIDefinition) DecodeFromDB() {
new_version := make(map[string]VersionInfo)
for k, v := range a.VersionData.Versions {
newK, decErr := base64.StdEncoding.DecodeString(k)
if decErr != nil {
newK, err := base64.StdEncoding.DecodeString(k)
if err != nil {
log.Error("Couldn't Decode, leaving as it may be legacy...")
new_version[k] = v
} else {
Expand All @@ -389,5 +388,4 @@ func (a *APIDefinition) DecodeFromDB() {
}

a.VersionData.Versions = new_version
// log.Warning(a.VersionData.Versions)
}
8 changes: 3 additions & 5 deletions apidef/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ func (n NotificationsManager) SendRequest(wait bool, count int, notification int

req.AddHeader("X-Tyk-Shared-Secret", n.SharedSecret)

resp, reqErr := req.Do()

if reqErr != nil {
log.Error("Request failed, trying again in 10s. Error was: ", reqErr)
resp, err := req.Do()
if err != nil {
log.Error("Request failed, trying again in 10s. Error was: ", err)
count++
go n.SendRequest(true, count, notification)
return
}

if resp.StatusCode != 200 {
log.Error("Request returned non-200 status, trying again in 10s.")
count++
Expand Down

0 comments on commit fb329e2

Please sign in to comment.