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

Optimization: prevent empty COMMIT calls #166

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chaffeqa
Copy link

Prevents BEGIN COMMIT empty database calls after each rails request if the session did not change.

Don't know why the write_session is called in our app every request, but monkey patching using this logic prevents an empty write at the end of each request.

Prevents `BEGIN COMMIT` empty database calls after each rails request if the session did not change.

Don't know why the `write_session` is called in our app every request, but monkey patching using this logic prevents an empty write at the end of each request.
Copy link
Member

@sikachu sikachu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. Please see my inline comment below.

lib/action_dispatch/session/active_record_store.rb Outdated Show resolved Hide resolved
@chaffeqa chaffeqa requested a review from sikachu May 3, 2021 16:10
@h0jeZvgoxFepBQ2C
Copy link

Can this be merged?

@preethi29
Copy link

any update on this? this seems to be useful.

Also the store seems to record empty session on every request without valid session. Is there a way to optimise it other than overriding save?

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.

4 participants