Skip to content

Commit

Permalink
fix: stop print stats after finish
Browse files Browse the repository at this point in the history
  • Loading branch information
veezhang committed Mar 8, 2023
1 parent d97c824 commit 4dad7d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type (
hooks *Hooks
chStart chan struct{}
done chan struct{}
donePrintStats chan struct{}
logger logger.Logger
}

Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -384,6 +387,8 @@ func (m *defaultManager) loopPrintStats() {
select {
case <-ticker.C:
m.logStats()
case <-m.donePrintStats:
return
case <-m.done:
return
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/spec/v3/edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 4dad7d3

Please sign in to comment.