mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-24 02:57:35 +01:00
167e8f18da
* Prevent deadlock in indexer initialisation during graceful restart * Move from gracehttp to our own service to add graceful ssh * Add timeout for start of indexers and make hammer time configurable * Fix issue with re-initialization in indexer during tests * move the code to detect use of closed to graceful * Handle logs gracefully - add a pid suffix just before restart * Move to using a cond and a holder for indexers * use time.Since * Add some comments and attribution * update modules.txt * Use zero to disable timeout * Move RestartProcess to its own file * Add cleanup routine
38 lines
846 B
Go
38 lines
846 B
Go
// +build windows
|
|
|
|
// Copyright 2016 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"crypto/tls"
|
|
"net/http"
|
|
)
|
|
|
|
func runHTTP(listenAddr string, m http.Handler) error {
|
|
return http.ListenAndServe(listenAddr, m)
|
|
}
|
|
|
|
func runHTTPS(listenAddr, certFile, keyFile string, m http.Handler) error {
|
|
return http.ListenAndServeTLS(listenAddr, certFile, keyFile, m)
|
|
}
|
|
|
|
func runHTTPSWithTLSConfig(listenAddr string, tlsConfig *tls.Config, m http.Handler) error {
|
|
server := &http.Server{
|
|
Addr: listenAddr,
|
|
Handler: m,
|
|
TLSConfig: tlsConfig,
|
|
}
|
|
return server.ListenAndServeTLS("", "")
|
|
}
|
|
|
|
// NoHTTPRedirector is a no-op on Windows
|
|
func NoHTTPRedirector() {
|
|
}
|
|
|
|
// NoMainListener is a no-op on Windows
|
|
func NoMainListener() {
|
|
}
|