mirror of
https://github.com/kataras/iris.git
synced 2026-01-23 03:45:56 +00:00
Make ExecRouteAgainst to work better and fix gorillamux and httprouter, remove of contextlinker policy it's useless now
Former-commit-id: 8d3501e6c490d630d3a4bec0c077dcd7d532242f
This commit is contained in:
10
iris.go
10
iris.go
@@ -340,6 +340,16 @@ func New(setters ...OptionSetter) *Framework {
|
||||
if routerBuilder != nil {
|
||||
// buid the router using user's selection build policy
|
||||
s.Router.build(routerBuilder)
|
||||
|
||||
s.Router.repository.OnMethodChanged(func(route RouteInfo, oldMethod string) {
|
||||
// set service not available temporarily until the router completes the building
|
||||
// this won't take more than 100ms, but we want to inform the user.
|
||||
s.Router.handler = ToNativeHandler(s, HandlerFunc(func(ctx *Context) {
|
||||
ctx.EmitError(StatusServiceUnavailable)
|
||||
}))
|
||||
// Re-build the whole router if state changed (from offline to online state mostly)
|
||||
s.Router.build(routerBuilder)
|
||||
})
|
||||
}
|
||||
}
|
||||
}})
|
||||
|
||||
Reference in New Issue
Block a user