Resolve issue with reloading configuration

This commit is contained in:
Trevor Slocum 2019-07-10 00:53:57 -07:00
parent 2562d0804b
commit 52044712c1
1 changed files with 7 additions and 6 deletions

13
main.go
View File

@ -89,13 +89,14 @@ func main() {
defer s.closeDatabase()
sighup := make(chan os.Signal, 1)
signal.Notify(sighup,
syscall.SIGHUP)
signal.Notify(sighup, syscall.SIGHUP)
go func() {
<-sighup
err := s.reload()
if err != nil {
log.Println(err)
for {
<-sighup
err := s.reload()
if err != nil {
log.Println(err)
}
}
}()