Browse Source

Update server.go

pull/15/head
Jason 5 years ago
parent
commit
a182fa8bde
  1. 8
      component/session/server.go

8
component/session/server.go

@ -23,7 +23,7 @@ var (
)
type Server struct {
server *http.Server
*http.Server
activeSessionMap sync.Map
completedSessionQueue *queue.Queue
}
@ -118,16 +118,16 @@ func (s *Server) Start() error {
http.Redirect(w, r, ServePath, 301)
})
mux.HandleFunc(ServePath, s.handler)
s.server = &http.Server{Addr: ServeAddr, Handler: mux}
s.Server = &http.Server{Addr: ServeAddr, Handler: mux}
go func() {
s.server.Serve(c)
s.Serve(c)
}()
return nil
}
func (s *Server) Stop() error {
return s.server.Close()
return s.Close()
}
func (s *Server) AddSession(key interface{}, session *Session) {

Loading…
Cancel
Save