Rename block to hupReady
Remove the write to the channel as per comments.
This commit is contained in:
parent
d8651302fc
commit
4b43e825f4
7
main.go
7
main.go
|
@ -251,10 +251,10 @@ func (p *prometheus) Serve() {
|
||||||
// early as possible, but ignore it until we are ready to handle reloading
|
// early as possible, but ignore it until we are ready to handle reloading
|
||||||
// our config.
|
// our config.
|
||||||
hup := make(chan os.Signal)
|
hup := make(chan os.Signal)
|
||||||
block := make(chan bool)
|
hupReady := make(chan bool)
|
||||||
signal.Notify(hup, syscall.SIGHUP)
|
signal.Notify(hup, syscall.SIGHUP)
|
||||||
go func() {
|
go func() {
|
||||||
<-block
|
<-hupReady
|
||||||
for range hup {
|
for range hup {
|
||||||
p.reloadConfig()
|
p.reloadConfig()
|
||||||
}
|
}
|
||||||
|
@ -293,8 +293,7 @@ func (p *prometheus) Serve() {
|
||||||
go p.webService.Run()
|
go p.webService.Run()
|
||||||
|
|
||||||
// Wait for reload or termination signals.
|
// Wait for reload or termination signals.
|
||||||
block <- true // Unblock SIGHUP handler.
|
close(hupReady) // Unblock SIGHUP handler.
|
||||||
close(block)
|
|
||||||
|
|
||||||
term := make(chan os.Signal)
|
term := make(chan os.Signal)
|
||||||
signal.Notify(term, os.Interrupt, syscall.SIGTERM)
|
signal.Notify(term, os.Interrupt, syscall.SIGTERM)
|
||||||
|
|
Loading…
Reference in New Issue