mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-31 03:23:05 -07:00
general: lint clean, vet clean
This commit is contained in:
@@ -40,6 +40,9 @@ type httpServer struct {
|
||||
grace *graceful.Server
|
||||
}
|
||||
|
||||
// Start runs the server and blocks until it has exited.
|
||||
//
|
||||
// It panics if the server exits unexpectedly.
|
||||
func (s *httpServer) Start() {
|
||||
s.grace = &graceful.Server{
|
||||
Server: &http.Server{
|
||||
@@ -81,6 +84,7 @@ func (s *httpServer) Start() {
|
||||
log.Println("HTTP server shut down cleanly")
|
||||
}
|
||||
|
||||
// Stop stops the server and blocks until the server has exited.
|
||||
func (s *httpServer) Stop() {
|
||||
s.grace.Stop(s.grace.Timeout)
|
||||
<-s.grace.StopChan()
|
||||
|
||||
Reference in New Issue
Block a user