feat: implement context handling with timeout and goroutine management
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"sipro-mps/internal/redis"
|
||||
"sipro-mps/pkg/utils"
|
||||
"time"
|
||||
@@ -69,6 +70,9 @@ type RateLimitTransport struct {
|
||||
func (t *RateLimitTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
ctx := req.Context()
|
||||
|
||||
req.Header.Set("X-Client-Secret", os.Getenv("WB_SECRET_TOKEN"))
|
||||
req.Header.Set("User-Agent", "wbas_seller.denco.store3547")
|
||||
|
||||
tokenString := req.Header.Get("Authorization")
|
||||
authData := utils.NewWbAuthData(tokenString)
|
||||
authDataBytes, err := json.Marshal(authData)
|
||||
|
||||
Reference in New Issue
Block a user