mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
Update to 7.1.1. Read HISTORY.md
Fix https://github.com/iris-contrib/community-board/issues/11 Read the latest fixes and features by visiting: https://github.com/kataras/iris/blob/master/HISTORY.md Former-commit-id: 7f35481f917673d0bbb356a4816d9cf54cc0c9ba
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"os/signal"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
|
||||
"github.com/kataras/iris/core/errors"
|
||||
"github.com/kataras/iris/core/nettools"
|
||||
@@ -138,7 +139,16 @@ func (su *Supervisor) supervise(blockFunc func() error) error {
|
||||
// we do it here. These tasks are canceled already too.
|
||||
go func() {
|
||||
ch := make(chan os.Signal, 1)
|
||||
signal.Notify(ch, os.Interrupt, os.Kill)
|
||||
signal.Notify(ch,
|
||||
// kill -SIGINT XXXX or Ctrl+c
|
||||
os.Interrupt,
|
||||
syscall.SIGINT, // register that too, it should be ok
|
||||
// os.Kill is equivalent with the syscall.SIGKILL
|
||||
os.Kill,
|
||||
syscall.SIGKILL, // register that too, it should be ok
|
||||
// kill -SIGTERM XXXX
|
||||
syscall.SIGTERM,
|
||||
)
|
||||
select {
|
||||
case <-ch:
|
||||
su.Scheduler.runOnInterrupt(host)
|
||||
|
||||
Reference in New Issue
Block a user