Skip to content

Commit

Permalink
ignore the down state API
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxu19830126 committed May 16, 2019
1 parent 5aa434a commit 29d5fc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/proxy/dispatcher_copy_on_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (r *dispatcher) copyAPIs(exclude uint64, excludeToRoute uint64) (*route.Rou
for key, value := range r.apis {
if key != exclude {
values[key] = value.clone()
if key != excludeToRoute {
if key != excludeToRoute && value.isUp() {
route.Add(values[key].meta)
}
}
Expand Down
9 changes: 6 additions & 3 deletions pkg/proxy/dispatcher_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ func (r *dispatcher) addAPI(api *metapb.API) error {
a := newAPIRuntime(api, r.tw, r.refreshQPS(api.MaxQPS))
newRoute, newValues := r.copyAPIs(0, 0)
newValues[api.ID] = a
err := newRoute.Add(a.meta)
if err != nil {
return err

if a.isUp() {
err := newRoute.Add(a.meta)
if err != nil {
return err
}
}

if a.cb != nil {
Expand Down

0 comments on commit 29d5fc4

Please sign in to comment.