1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-22 03:15:58 +00:00

version 12.1.5

Former-commit-id: cda69f08955cb0d594e98bf26197ee573cbba4b2
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-02-02 16:29:06 +02:00
parent e04ea83c04
commit 3093d65363
76 changed files with 9647 additions and 366 deletions

23
iris.go
View File

@@ -41,7 +41,7 @@ import (
)
// Version is the current version number of the Iris Web Framework.
const Version = "12.1.4"
const Version = "12.1.5"
// HTTP status codes as registered with IANA.
// See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.
@@ -636,17 +636,9 @@ func (app *Application) NewHost(srv *http.Server) *host.Supervisor {
// A shortcut for the `host#RegisterOnInterrupt`.
var RegisterOnInterrupt = host.RegisterOnInterrupt
// Shutdown gracefully terminates all the application's server hosts.
// Shutdown gracefully terminates all the application's server hosts and any tunnels.
// Returns an error on the first failure, otherwise nil.
func (app *Application) Shutdown(ctx stdContext.Context) error {
for _, t := range app.config.Tunneling.Tunnels {
if t.Name == "" {
continue
}
app.config.Tunneling.stopTunnel(t)
}
for i, su := range app.Hosts {
app.logger.Debugf("Host[%d]: Shutdown now", i)
if err := su.Shutdown(ctx); err != nil {
@@ -654,6 +646,17 @@ func (app *Application) Shutdown(ctx stdContext.Context) error {
return err
}
}
for _, t := range app.config.Tunneling.Tunnels {
if t.Name == "" {
continue
}
if err := app.config.Tunneling.stopTunnel(t); err != nil {
return err
}
}
return nil
}