Skip to content

Commit

Permalink
fixing build after merging in master
Browse files Browse the repository at this point in the history
  • Loading branch information
dencoded committed Nov 27, 2017
1 parent a013697 commit 53e8a0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
12 changes: 4 additions & 8 deletions api_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import (
"net/url"
"sort"
"strings"
"sync"
"sync/atomic"

"github.com/Sirupsen/logrus"
"github.com/gorilla/mux"
"github.com/justinas/alice"

"sync"
"sync/atomic"

"github.com/TykTechnologies/tyk/apidef"
"github.com/TykTechnologies/tyk/config"
"github.com/TykTechnologies/tyk/coprocess"
Expand Down Expand Up @@ -524,11 +523,8 @@ func (d *DummyProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func loadGlobalApps() {
// we need to make a full copy of the slice, as loadApps will
// use in-place to sort the apis.
apisMu.RLock()
specs := make([]*APISpec, len(apiSpecs))
copy(specs, apiSpecs)
apisMu.RUnlock()
loadApps(specs, mainRouter)
specs := getApiSpecs()
loadApps(specs, mainRouter, &mainRouterMu)
}

// Create the individual API (app) specs based on live configurations and assign middleware
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ func doReload() {
syncPolicies()
// load the specs
count := syncAPISpecs()
// skip re-loading only if dashboard service reported 0 APIs
// skip re-loading only if dashboard service reported 0 APIs
// and current registry had 0 APIs
if count == 0 && apisByIDLen() == 0 {
log.WithFields(logrus.Fields{
Expand Down
3 changes: 2 additions & 1 deletion rpc_backup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ func doLoadWithBackup(specs []*APISpec) {
loadAPIEndpoints(mainRouter, &mainRouterMu)

log.Warning("[RPC Backup] --> Loading APIs")
loadApps(specs, mainRouter, &mainRouterMu)
currSpecs := getApiSpecs()
loadApps(currSpecs, mainRouter, &mainRouterMu)
log.Warning("[RPC Backup] --> API Load Done")

newServeMux := http.NewServeMux()
Expand Down

0 comments on commit 53e8a0d

Please sign in to comment.