mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-02-10 05:22:42 +00:00
bot: Wait catch SIGTERM (#233)
Signed-off-by: Daniel Boman <daniel.boman@pm.me>
This commit is contained in:
parent
1b12057e51
commit
917459611d
|
@ -8,6 +8,7 @@ import (
|
|||
"os/signal"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
@ -267,7 +268,7 @@ func Run(token string, cmd interface{}, opts func(*Context) error) {
|
|||
// WaitForInterrupt blocks until SIGINT.
|
||||
func WaitForInterrupt() {
|
||||
sigs := make(chan os.Signal, 1)
|
||||
signal.Notify(sigs, os.Interrupt)
|
||||
signal.Notify(sigs, os.Interrupt, syscall.SIGTERM)
|
||||
<-sigs
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue