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

Support multiple requests #104

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Support multiple requests #104

merged 1 commit into from
Dec 1, 2023

Conversation

Stevemoretz
Copy link
Contributor

I use this tool specially in unit tests, and in unit tests sometimes you end up having multiple requests in a test (This isn't specifically related to unit tests, internal API calls for instance would suffer from the same problem.), your package was counting the previous queries from the previous requests in, causing it to think n+1 queries exists since repeated queries exist regardless of the fact that those queries had happened in a different context (in the previous requests) so I made sure your package won't register multiple listeners or count in the stale queries from previous attempts.

So that's what this pull request does, 2 tests are written to ensure now multiple requests will work for detecting the n+1 queries and not detecting regular queries as n+1 queries.

That's all folks, that's in advance for considering this pull request.

@mpociot mpociot merged commit cdf0649 into beyondcode:master Dec 1, 2023
@mpociot
Copy link
Member

mpociot commented Dec 1, 2023

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