Skip to content

Commit

Permalink
Merge 69948aa into 69df1ab
Browse files Browse the repository at this point in the history
  • Loading branch information
Cluas committed Mar 29, 2022
2 parents 69df1ab + 69948aa commit 8d8f644
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (c *config) Load() error {
return err
}
for _, v := range kvs {
c.log.Infof("config loaded: %s format: %s", v.Key, v.Format)
c.log.Debugf("config loaded: %s format: %s", v.Key, v.Format)
}
if err = c.reader.Merge(kvs...); err != nil {
c.log.Errorf("failed to merge config source: %v", err)
Expand Down
8 changes: 4 additions & 4 deletions contrib/registry/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func New(c *Config, logger log.Logger) *Discovery {
if !ok {
panic("Discovery watch self failed")
}
discoveryIns, ok := r.Fetch(context.Background())
discoveryIns, ok := r.fetch(context.Background())
if ok {
d.newSelf(discoveryIns.Instances)
}
Expand All @@ -105,7 +105,7 @@ func (d *Discovery) selfProc(resolver *Resolve, event <-chan struct{}) {
if !ok {
return
}
zones, ok := resolver.Fetch(context.Background())
zones, ok := resolver.fetch(context.Background())
if ok {
d.newSelf(zones.Instances)
}
Expand Down Expand Up @@ -444,8 +444,8 @@ func (r *Resolve) Watch() <-chan struct{} {
return r.event
}

// Fetch resolver instance.
func (r *Resolve) Fetch(ctx context.Context) (ins *disInstancesInfo, ok bool) {
// fetch resolver instance.
func (r *Resolve) fetch(ctx context.Context) (ins *disInstancesInfo, ok bool) {
r.d.mutex.RLock()
app, ok := r.d.apps[r.id]
r.d.mutex.RUnlock()
Expand Down
4 changes: 2 additions & 2 deletions contrib/registry/discovery/impl_discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func filterInstancesByZone(ins *disInstancesInfo, zone string) []*registry.Servi

func (d *Discovery) GetService(ctx context.Context, serviceName string) ([]*registry.ServiceInstance, error) {
r := d.resolveBuild(serviceName)
ins, ok := r.Fetch(ctx)
ins, ok := r.fetch(ctx)
if !ok {
return nil, errors.New("Discovery.GetService fetch failed")
}
Expand Down Expand Up @@ -70,7 +70,7 @@ func (w *watcher) Next() ([]*registry.ServiceInstance, error) {
ctx, cancel := context.WithTimeout(context.TODO(), 15*time.Second)
defer cancel()

ins, ok := w.Resolve.Fetch(ctx)
ins, ok := w.Resolve.fetch(ctx)
if !ok {
return nil, errors.New("Discovery.GetService fetch failed")
}
Expand Down
1 change: 0 additions & 1 deletion contrib/registry/polaris/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var (
const _instanceIDSeparator = "-"

type options struct {

// required, namespace in polaris
Namespace string

Expand Down
2 changes: 1 addition & 1 deletion log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// DefaultLogger is default logger.
var DefaultLogger Logger = NewStdLogger(log.Writer())
var DefaultLogger = NewStdLogger(log.Writer())

// Logger is a logger interface.
type Logger interface {
Expand Down

0 comments on commit 8d8f644

Please sign in to comment.