service graceful shutdown

This commit is contained in:
ginuerzh
2025-01-08 23:12:06 +08:00
parent eef3bd7f25
commit 489a762811
4 changed files with 33 additions and 9 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ package recorder
import (
"bytes"
"context"
"fmt"
"errors"
"net/http"
"strings"
"time"
@@ -80,7 +80,7 @@ func (r *httpRecorder) Record(ctx context.Context, b []byte, opts ...recorder.Re
defer resp.Body.Close()
if resp.StatusCode >= http.StatusBadRequest {
return fmt.Errorf(resp.Status)
return errors.New(resp.Status)
}
return nil