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

Simply return value after write in active_record container backend #671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doits
Copy link
Contributor

@doits doits commented Feb 9, 2025

Simply return value after write in active_record container backend

This fixes a bug where #read is overwritten by the cache plugin and
therefore the container backend returns stale data. It should always
return the value it wrote.

Since value is never modified by this backend it makes no sense to
read it again after setting it.

Besides fixing the bug it might give a small perfomance boost, too.

fixes https://github.com/shioyama/mobility/pull/543/files#r1944637671

thanks @dramalho for uncovering the bug and hints

This fixes a bug where `#read` is overwritten by the cache plugin and
therefore the container backend returns stale data. It should always
return the value it wrote.

Since `value` is never modified by this backend it makes no sense to
read it again after setting it.

Besides fixing the bug it might give a small perfomance boost, too.

fixes https://github.com/shioyama/mobility/pull/543/files#r1944637671

thanks @dramalho for uncovering the bug and hints
@dramalho
Copy link

dramalho commented Feb 9, 2025

Lovely, thank you ☺️

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.

2 participants