first commit
This commit is contained in:
22
config/reload_unix.go
Normal file
22
config/reload_unix.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// +build !windows,!plan9
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func signalReload() {
|
||||
ch := make(chan os.Signal, 1)
|
||||
signal.Notify(ch, syscall.SIGUSR1)
|
||||
|
||||
for {
|
||||
sig := <-ch
|
||||
switch sig {
|
||||
case syscall.SIGUSR1:
|
||||
ReloadConfigFile()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user