Remove precache in favour of just pulling by default
This commit is contained in:
parent
b93cd0c964
commit
8674dc8e62
@ -24,8 +24,6 @@ type Options struct {
|
|||||||
Advertise Strategy
|
Advertise Strategy
|
||||||
// Context for additional options
|
// Context for additional options
|
||||||
Context context.Context
|
Context context.Context
|
||||||
// Precache the route table on router startup
|
|
||||||
Precache bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Id sets Router Id
|
// Id sets Router Id
|
||||||
@ -70,13 +68,6 @@ func Advertise(a Strategy) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Precache sets whether to precache the route table
|
|
||||||
func Precache(b bool) Option {
|
|
||||||
return func(o *Options) {
|
|
||||||
o.Precache = b
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// DefaultOptions returns router default options
|
// DefaultOptions returns router default options
|
||||||
func DefaultOptions() Options {
|
func DefaultOptions() Options {
|
||||||
return Options{
|
return Options{
|
||||||
|
@ -473,12 +473,10 @@ func (r *rtr) start() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.options.Precache {
|
|
||||||
// add all local service routes into the routing table
|
// add all local service routes into the routing table
|
||||||
if err := r.manageRegistryRoutes(r.options.Registry, "create"); err != nil {
|
if err := r.manageRegistryRoutes(r.options.Registry, "create"); err != nil {
|
||||||
return fmt.Errorf("failed adding registry routes: %s", err)
|
return fmt.Errorf("failed adding registry routes: %s", err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// add default gateway into routing table
|
// add default gateway into routing table
|
||||||
if r.options.Gateway != "" {
|
if r.options.Gateway != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user