diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index 0866ad85..8ead572d 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -50,6 +50,7 @@ type ( hooks *Hooks chStart chan struct{} done chan struct{} + donePrintStats chan struct{} logger logger.Logger } @@ -72,6 +73,7 @@ func NewWithOpts(opts ...Option) Manager { hooks: &Hooks{}, chStart: make(chan struct{}), done: make(chan struct{}), + donePrintStats: make(chan struct{}), } for _, opt := range opts { @@ -233,6 +235,7 @@ func (m *defaultManager) Wait() error { m.readerWaitGroup.Wait() m.importerWaitGroup.Wait() + close(m.donePrintStats) m.logStats() if err := m.After(); err != nil { @@ -384,6 +387,8 @@ func (m *defaultManager) loopPrintStats() { select { case <-ticker.C: m.logStats() + case <-m.donePrintStats: + return case <-m.done: return } diff --git a/pkg/spec/v3/edge.go b/pkg/spec/v3/edge.go index 58da0454..b528891e 100644 --- a/pkg/spec/v3/edge.go +++ b/pkg/spec/v3/edge.go @@ -14,7 +14,7 @@ type ( Name string `yaml:"name"` Src *EdgeNodeRef `yaml:"src"` Dst *EdgeNodeRef `yaml:"dst"` - Rank *Rank `yaml:"rank"` + Rank *Rank `yaml:"rank,omitempty"` Props Props `yaml:"props,omitempty"` IgnoreExistedIndex *bool `yaml:"ignoreExistedIndex,omitempty"`