Skip to content

Commit 468e3d5

Browse files
committed
Don't delay throwing an exception if the last retry fails
1 parent d278cd8 commit 468e3d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/typesense/api_call.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def perform_request(method, endpoint, query_parameters: nil, body_parameters: ni
112112
last_exception = e
113113
@logger.warn "Request #{method}:#{uri_for(endpoint, node)} to Node #{node[:index]} failed due to \"#{e.class}: #{e.message}\""
114114
@logger.warn "Sleeping for #{@retry_interval_seconds}s and then retrying request..."
115-
sleep @retry_interval_seconds
115+
sleep @retry_interval_seconds if num_tries <= @num_retries_per_request
116116
end
117117
end
118118
@logger.debug "No retries left. Raising last error \"#{last_exception.class}: #{last_exception.message}\"..."

0 commit comments

Comments
 (0)