Skip to content

Commit

Permalink
fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
daixiang0 committed May 27, 2019
1 parent f94f2dd commit f9014bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 3 additions & 7 deletions cmd/promtail/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@ func main() {
m.Cancel <- struct{}{}
}

select {
case <- errChan:
m.Promtail.Shutdown()
os.Exit(1)
}

//m.WaitSignals(errChan)
<-errChan
m.Promtail.Shutdown()
os.Exit(1)
} else {
level.Error(util.Logger).Log("msg", "config file not found", "error", nil)
os.Exit(1)
Expand Down
6 changes: 3 additions & 3 deletions pkg/promtail/promtail.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Promtail struct {
type Master struct {
Promtail *Promtail
defaultCfg *config.Config
Cancel chan struct{}
Cancel chan struct{}
}

func InitMaster(configFile string, cfg config.Config) (*Master, error) {
Expand All @@ -46,7 +46,7 @@ func InitMaster(configFile string, cfg config.Config) (*Master, error) {
m := &Master{
Promtail: p,
defaultCfg: &cfg,
Cancel:cancel,
Cancel: cancel,
}

p.Server.HTTP.Path("/reload").Handler(http.HandlerFunc(m.Reload))
Expand All @@ -67,7 +67,7 @@ func (m *Master) DoReload() {
m.Promtail.Server.Stop()

// wait old promtail shutdown
<- m.Cancel
<-m.Cancel

p, err := New(m.Promtail.configFile, *m.defaultCfg)
if err != nil {
Expand Down

0 comments on commit f9014bf

Please sign in to comment.