You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The StatementCache uses a different code path for generating SQL and executing queries, so it doesn't currently benefit from the ability to mark queries as retryable. This mainly affects association SELECTs, because the other user of StatementCache is find_by and it explicitly passes allow_retry: true when executing a cached query.
Detail
This commit enables queries that would be retryable without using the StatementCache to also be retryable when using it. Just like in to_sql_and_binds, cacheable_query now sets retryable: true on the collector that constructs the query and additionally copies the collector's final retryable value to the query object. Then, instead of accepting an allow_retry parameter when executing the cached query, execute now uses the query object's retryable attribute.
Checklist
Before submitting the PR make sure the following are checked:
This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
Tests are added or updated if you fix a bug or add a feature.
CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.
Motivation / Background
The StatementCache uses a different code path for generating SQL and executing queries, so it doesn't currently benefit from the ability to mark queries as retryable. This mainly affects association SELECTs, because the other user of StatementCache is
find_by
and it explicitly passesallow_retry: true
when executing a cached query.Detail
This commit enables queries that would be retryable without using the StatementCache to also be retryable when using it. Just like in
to_sql_and_binds
,cacheable_query
now setsretryable: true
on thecollector
that constructs the query and additionally copies thecollector
's finalretryable
value to the query object. Then, instead of accepting anallow_retry
parameter when executing the cached query,execute
now uses the query object'sretryable
attribute.Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
Originally posted by @skipkayhil in rails/rails#54436
Originally posted by @xXxrAinSonic in https://github.com/iobroker-community-adapters/ioBroker.smartcontrol/issues/229
Originally posted by @xXxrAinSonic in opa334/Dopamine#680
The text was updated successfully, but these errors were encountered: