Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allow_retry kwarg to execute #2366

Closed
wants to merge 1 commit into from
Closed

Conversation

andynu
Copy link
Contributor

@andynu andynu commented Mar 19, 2024

This extends the existing class level auto_retry functionality to optionally allow an allow_retry boolean kwarg to allow retry of specific queries.

This PR preserves the requirement that autocommit? be enabled which is the safer choice.

  def with_retry(allow_retry: false) # :nodoc:
    should_retry = (allow_retry || self.class.auto_retry?) && autocommit?

See issue #2310

@andynu andynu force-pushed the allow-retry-2310 branch from 5797871 to 7e566d5 Compare March 19, 2024 01:41
This extends the existing class level auto_retry functionality to
optionally allow an allow_retry boolean kwarg to allow retry of specific
queries.

This PR preserves the requirement that `autocommit?` be enabled which is the
safer choice.

```
  def with_retry(allow_retry: false) # :nodoc:
    should_retry = (allow_retry || self.class.auto_retry?) && autocommit?
```

See issue rsim#2310
@andynu andynu force-pushed the allow-retry-2310 branch from 7e566d5 to c468f3c Compare March 19, 2024 03:55
@andynu andynu changed the title Add allow_retry kwarg to execute Add allow_retry kwarg to execute (1/10) Mar 25, 2024
@andynu andynu changed the title Add allow_retry kwarg to execute (1/10) Add allow_retry kwarg to execute Mar 25, 2024
@andynu andynu closed this Mar 25, 2024
@andynu
Copy link
Contributor Author

andynu commented Mar 25, 2024

Dup of #2374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant