Skip to content

Commit

Permalink
return the not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
Asim Aslam committed Oct 28, 2017
1 parent 1890ec7 commit e7104d6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion selector/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,20 @@ func (c *cacheSelector) get(service string) ([]*registry.Service, error) {
}

// expired entry so get service
if services, err := get(service); err == nil {
services, err := get(service)

// no error then return error
if err == nil {
return services, nil
}

// not found error then return
if err == registry.ErrNotFound {
return nil, selector.ErrNotFound
}

// other error

// return expired cache as last resort
return c.cp(services), nil
}
Expand Down

0 comments on commit e7104d6

Please sign in to comment.