mirror of
https://github.com/kataras/iris.git
synced 2026-03-05 16:05:58 +00:00
Catch os.Interrupt signal with iris.PostInterrupt example added in comments.
https://github.com/iris-contrib/examples/tree/master/os_interrupt
This commit is contained in:
2
iris.go
2
iris.go
@@ -541,7 +541,9 @@ func (s *Framework) postServe() {
|
||||
ch := make(chan os.Signal, 1)
|
||||
signal.Notify(ch, os.Interrupt)
|
||||
<-ch
|
||||
|
||||
// catch custom plugin event for interrupt
|
||||
// Example: https://github.com/iris-contrib/examples/tree/master/os_interrupt
|
||||
s.Plugins.DoPostInterrupt(s)
|
||||
if !s.Plugins.PostInterruptFired() {
|
||||
// if no PostInterrupt events fired, then I assume that the user doesn't cares
|
||||
|
||||
Reference in New Issue
Block a user