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

Optimize nikola check #2027

Merged
merged 2 commits into from Sep 6, 2015
Merged

Optimize nikola check #2027

merged 2 commits into from Sep 6, 2015

Conversation

felixfontein
Copy link
Contributor

When nikola check is run with more than one flag, it runs _call_nikola_list several times to retrieve the same data. Adds a (optional) cache to avoid unnecessary calls.

This also fixes failure return in _execute().

def _call_nikola_list(site):
def _call_nikola_list(site, cache=None):
if cache is not None:
if 'files' in cache and 'deps' in cache:
Copy link
Member

Choose a reason for hiding this comment

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

Is this check necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because this checks if the values are in the cache. (Just checking one of the two is fine as well.)

Copy link
Member

Choose a reason for hiding this comment

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

I would just trust that a correct cache is given, but okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Somehow the cache must be filled when the values are not in there yet.

Copy link
Member

Choose a reason for hiding this comment

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

I misunderstood the implementation slightly.

Kwpolska added a commit that referenced this pull request Sep 6, 2015
@Kwpolska Kwpolska merged commit 27dca29 into master Sep 6, 2015
@Kwpolska Kwpolska deleted the optimize-nikola-check branch September 6, 2015 08:12
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.

None yet

2 participants