Refactor marketplace product fetching and caching logic; update environment configuration for Redis and PostgreSQL
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/redis/rueidis"
|
||||
"net/http"
|
||||
"sipro-mps/internal/redis"
|
||||
"sipro-mps/pkg/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -68,12 +69,12 @@ func (t *RateLimitTransport) RoundTrip(req *http.Request) (*http.Response, error
|
||||
ctx := req.Context()
|
||||
|
||||
tokenString := req.Header.Get("Authorization")
|
||||
authData := NewWbAuthData(tokenString)
|
||||
authData := utils.NewWbAuthData(tokenString)
|
||||
authDataBytes, err := json.Marshal(authData)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to marshal Wildberries auth data: %w", err)
|
||||
}
|
||||
_, claims, err := DecodeWildberriesJwt(authDataBytes)
|
||||
_, claims, err := utils.DecodeWildberriesJwt(authDataBytes)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to decode Wildberries JWT: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user