@@ -2,7 +2,6 @@ package httpclient
22
33import (
44 "bytes"
5- "context"
65 "encoding/base64"
76 "fmt"
87 "io"
@@ -26,8 +25,6 @@ import (
2625// DoMultiPartRequest creates and executes a multipart/form-data HTTP request for file uploads and form fields.
2726func (c * Client ) DoMultiPartRequest (method , endpoint string , files map [string ][]string , params map [string ]string , contentTypes map [string ]string , headersMap map [string ]http.Header , out interface {}) (* http.Response , error ) {
2827 log := c .Logger
29- ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Minute )
30- defer cancel () // Ensure the context is canceled when the function returns
3128
3229 // Ensure the method is supported
3330 if method != http .MethodPost && method != http .MethodPut {
@@ -48,14 +45,6 @@ func (c *Client) DoMultiPartRequest(method, endpoint string, files map[string][]
4845 return nil , err
4946 }
5047
51- // Acquire a concurrency permit to control the number of concurrent requests.
52- ctx , requestID , err := c .ConcurrencyHandler .AcquireConcurrencyPermit (ctx )
53- if err != nil {
54- log .Error ("Failed to acquire concurrency permit" , zap .Error (err ))
55- return nil , err
56- }
57- defer c .ConcurrencyHandler .ReleaseConcurrencyPermit (requestID )
58-
5948 log .Debug ("Executing multipart request" , zap .String ("method" , method ), zap .String ("endpoint" , endpoint ))
6049
6150 body , contentType , err := createMultipartRequestBody (files , params , contentTypes , headersMap , log )
@@ -86,8 +75,6 @@ func (c *Client) DoMultiPartRequest(method, endpoint string, files map[string][]
8675 headerHandler .SetRequestHeaders (endpoint )
8776 headerHandler .LogHeaders (c .clientConfig .ClientOptions .Logging .HideSensitiveData )
8877
89- req = req .WithContext (ctx )
90-
9178 startTime := time .Now ()
9279 resp , err := c .httpClient .Do (req )
9380 if err != nil {
0 commit comments