Move install pages out of main macaron routes (#13195)

* Move install pages out of main macaron loop

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update templates/post-install.tmpl

Co-authored-by: Lauris BH <lauris@nix.lv>

* remove prefetch

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2020-10-19 22:03:08 +01:00 committed by GitHub
parent 3ddf3f93d6
commit 2f1353a2f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 234 additions and 115 deletions

View file

@ -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.

View file

@ -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

View file

@ -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