diff options
Diffstat (limited to 'pkg/worker')
-rw-r--r-- | pkg/worker/httpserver.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/pkg/worker/httpserver.go b/pkg/worker/httpserver.go index 181cf73..dc8f255 100644 --- a/pkg/worker/httpserver.go +++ b/pkg/worker/httpserver.go @@ -2,29 +2,24 @@ package worker import ( "context" - - "github.com/valyala/fasthttp" + "net/http" ) type ServerWorker struct { - server *fasthttp.Server + server *http.Server } func (self *ServerWorker) Start(ctx context.Context) error { go func() { // nolint: errcheck - self.server.ListenAndServe("0.0.0.0:8080") + self.server.ListenAndServe() }() <-ctx.Done() - return self.Shutdown() -} - -func (self *ServerWorker) Shutdown() error { - return self.server.Shutdown() + return self.server.Shutdown(ctx) } -func NewServerWorker(server *fasthttp.Server) *ServerWorker { +func NewServerWorker(server *http.Server) *ServerWorker { return &ServerWorker{ server: server, } |