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

enhancing the function of is_module_installed to be faster #594

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

Conversation

mFlayyan
Copy link

@mFlayyan mFlayyan commented Mar 6, 2017

Current behavior before PR:
is_module_installed goes through all modules and look to their state to create a list of all modules that have state=Active then looks for module_name in that list

Desired behavior after PR is merged:
is_module_installed checks if module_name is in registry._init_module set so it takes less time

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@hbrunn hbrunn added this to the 9.0 milestone Mar 6, 2017
Copy link
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

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

note to fellow reviewers: This will speed up the backend because for every request, this function is called repeatedly, and will cause tens of extra database requests. Given we really only care about modules actually loaded (as opposed to modules supposed to be installed, but maybe not loaded due to some misconfiguration), I think this is fine

@bealdav
Copy link
Member

bealdav commented Mar 10, 2017

👍

@dreispt
Copy link
Sponsor Member

dreispt commented Mar 10, 2017

Shouldn't there be an upstream PR?

@pedrobaeza
Copy link
Member

I think so

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

Successfully merging this pull request may close these issues.

None yet

7 participants