From 2f1353a2f33762e10a304cbebf3a6a8d0381d316 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 19 Oct 2020 22:03:08 +0100 Subject: Move install pages out of main macaron routes (#13195) * Move install pages out of main macaron loop Signed-off-by: Andrew Thornton * Update templates/post-install.tmpl Co-authored-by: Lauris BH * remove prefetch Signed-off-by: Andrew Thornton --- modules/context/auth.go | 6 ------ modules/graceful/manager.go | 2 +- modules/graceful/server.go | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/context/auth.go b/modules/context/auth.go index 00a7032e27..02248384e1 100644 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -26,12 +26,6 @@ type ToggleOptions struct { // Toggle returns toggle options as middleware func Toggle(options *ToggleOptions) macaron.Handler { return func(ctx *Context) { - // Cannot view any page before installation. - if !setting.InstallLock { - ctx.Redirect(setting.AppSubURL + "/install") - return - } - isAPIPath := auth.IsAPIPath(ctx.Req.URL.Path) // Check prohibit login users. diff --git a/modules/graceful/manager.go b/modules/graceful/manager.go index 6b134e7d0c..903d05ed21 100644 --- a/modules/graceful/manager.go +++ b/modules/graceful/manager.go @@ -31,7 +31,7 @@ const ( // // If you add an additional place you must increment this number // and add a function to call manager.InformCleanup if it's not going to be used -const numberOfServersToCreate = 3 +const numberOfServersToCreate = 4 // Manager represents the graceful server manager interface var manager *Manager diff --git a/modules/graceful/server.go b/modules/graceful/server.go index db73174ac1..e7394f349e 100644 --- a/modules/graceful/server.go +++ b/modules/graceful/server.go @@ -162,7 +162,7 @@ func (srv *Server) Serve(serve ServeFunction) error { srv.setState(stateTerminate) GetManager().ServerDone() // use of closed means that the listeners are closed - i.e. we should be shutting down - return nil - if err != nil && strings.Contains(err.Error(), "use of closed") { + if err == nil || strings.Contains(err.Error(), "use of closed") || strings.Contains(err.Error(), "http: Server closed") { return nil } return err -- cgit v1.2.3