From f334a2db8e94b233d24c66e775ed40a9fd99adac Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Wed, 9 Jul 2025 10:35:43 +0800 Subject: [PATCH] feat: support max retry times option for driver session --- internal/version/VERSION | 2 +- uixt/driver_session.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/version/VERSION b/internal/version/VERSION index 6623a6b4..a778e596 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-250708 +v5.0.0-250709 diff --git a/uixt/driver_session.go b/uixt/driver_session.go index 07a6396f..4c654398 100644 --- a/uixt/driver_session.go +++ b/uixt/driver_session.go @@ -175,7 +175,13 @@ func (s *DriverSession) RequestWithRetry(method string, urlStr string, rawBody [ ) { var lastError error - for attempt := 1; attempt <= s.maxRetry; attempt++ { + maxRetry := s.maxRetry + options := option.NewActionOptions(opts...) + if options.MaxRetryTimes > 0 { + maxRetry = options.MaxRetryTimes + } + + for attempt := 1; attempt <= maxRetry; attempt++ { // Execute the request rawResp, err = s.Request(method, urlStr, rawBody, opts...) if err == nil {