mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Use a buffered os.Signal channel as argument to signal.Notify
signal.Notify documentation states that: Package signal will not block sending to c: the caller must ensure that c has sufficient buffer space to keep up with the expected signal rate. For a channel used for notification of just one signal value, a buffer of size 1 is sufficient.
This commit is contained in:
committed by
Dan Christian Bogos
parent
78077ae454
commit
c7d226f8bb
@@ -292,8 +292,8 @@ func cpuProfiling(cpuProfDir string, stopChan, doneChan chan struct{}, exitChan
|
||||
}
|
||||
|
||||
func singnalHandler(exitChan chan bool) {
|
||||
shutdownSignal := make(chan os.Signal)
|
||||
reloadSignal := make(chan os.Signal)
|
||||
shutdownSignal := make(chan os.Signal, 1)
|
||||
reloadSignal := make(chan os.Signal, 1)
|
||||
signal.Notify(shutdownSignal, os.Interrupt,
|
||||
syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
|
||||
signal.Notify(reloadSignal, syscall.SIGHUP)
|
||||
|
||||
Reference in New Issue
Block a user