message: op-service: Exit HTTP server more cleanly
diff: @@ -2,13 +2,14 @@ package httputil
  import (
  "context"
  + "errors"
  "fmt"
  "net/http"
  "time"
  )
  func ListenAndServeContext(ctx context.Context, server *http.Server) error {
  - errCh := make(chan error)
  + errCh := make(chan error, 1)
  go func() {
  errCh <- server.ListenAndServe()
  }()
  @@ -22,6 +23,19 @@ func ListenAndServeContext(ctx context.Context, server *http.Server) error {
  break
  }
  - <-ctx.Done()
  - return ctx.Err()
  + select {
  + case err := <-errCh:
  + if errors.Is(err, http.ErrServerClosed) {
  + return nil
  + }
  + return err
  + case <-ctx.Done():
  + _ = server.Shutdown(context.Background())
  +
  + err := ctx.Err()
  + if errors.Is(err, context.Canceled) {
  + return nil
  + }
  + return err
  + }
  }
  