Skip to content

Commit fe60fc5

Browse files
committed
fix: r
Signed-off-by: Ashing Zheng <[email protected]>
1 parent 20275cf commit fe60fc5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/provider/adc/adc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func New(updater status.Updater, readier readiness.ReadinessManager, opts ...Opt
115115
o := Options{}
116116
o.ApplyOptions(opts)
117117

118-
executor := NewHTTPADCExecutor("http://127.0.0.1:3000")
118+
executor := NewHTTPADCExecutor("http://127.0.0.1:3000", o.SyncTimeout)
119119
log.Infow("using HTTP ADC Executor", zap.String("server_url", "http://127.0.0.1:3000"))
120120

121121
return &adcClient{

internal/provider/adc/executor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ type HTTPADCExecutor struct {
227227
}
228228

229229
// NewHTTPADCExecutor creates a new HTTPADCExecutor with the specified ADC Server URL
230-
func NewHTTPADCExecutor(serverURL string) *HTTPADCExecutor {
230+
func NewHTTPADCExecutor(serverURL string, timeout time.Duration) *HTTPADCExecutor {
231231
return &HTTPADCExecutor{
232232
httpClient: &http.Client{
233-
Timeout: 30 * time.Second,
233+
Timeout: timeout,
234234
},
235235
serverURL: serverURL,
236236
}
@@ -272,7 +272,7 @@ func (e *HTTPADCExecutor) runHTTPSync(ctx context.Context, mode string, config a
272272

273273
// runHTTPSyncForSingleServer performs HTTP sync to a single ADC Server
274274
func (e *HTTPADCExecutor) runHTTPSyncForSingleServer(ctx context.Context, serverAddr, mode string, config adcConfig, args []string) error {
275-
ctx, cancel := context.WithTimeout(ctx, 15*time.Second)
275+
ctx, cancel := context.WithTimeout(ctx, e.httpClient.Timeout)
276276
defer cancel()
277277

278278
// Parse args to extract labels, types, and file path

0 commit comments

Comments
 (0)