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

fix: lazy cache #3892

Merged
merged 2 commits into from Feb 24, 2023
Merged

fix: lazy cache #3892

merged 2 commits into from Feb 24, 2023

Conversation

opalmay
Copy link
Contributor

@opalmay opalmay commented Feb 24, 2023

Calling lazy.cache.enable() in plugin_loader.init() doesn't work properly, it is before calling lazy setup and then the lazy setup calls cache.enable again on it's own.
Instead only override the path and let lazy do the rest. (already enabled in default lazy config)
Also remove the pcall, this is an internal variable and we would wanna know if it breaks in the future.
reset_cache is also removed as looks like that's not necessary.

Copy link
Member

@LostNeophyte LostNeophyte left a comment

Choose a reason for hiding this comment

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

it is before calling lazy setup and then the lazy setup calls cache.enable again on it's own.

it's not a problem, lazy checks if it was already enabled

Also remove the pcall, this is an internal variable and we would wanna know if it breaks in the future.

we need the pcall to support older versions of lazy

before this change lvim started 1.14x faster, but we unfortunately need it
image

@opalmay
Copy link
Contributor Author

opalmay commented Feb 24, 2023

it is before calling lazy setup and then the lazy setup calls cache.enable again on it's own.

it's not a problem, lazy checks if it was already enabled

Also remove the pcall, this is an internal variable and we would wanna know if it breaks in the future.

we need the pcall to support older versions of lazy

before this change lvim started 1.14x faster, but we unfortunately need it image

Added the pcall back.
If it already checks then root cause might've been enable() being called before setup(). Not exactly sure, but it works this way.

Copy link
Member

@LostNeophyte LostNeophyte left a comment

Choose a reason for hiding this comment

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

LGTM

@opalmay opalmay merged commit 2b1af90 into master Feb 24, 2023
@opalmay opalmay deleted the fix-lazy-cache branch February 24, 2023 15:08
opalmay added a commit that referenced this pull request Feb 24, 2023
* fix: lazy cache

* refactor: add pcall
tomazursic pushed a commit to tomazursic/LunarVim that referenced this pull request Feb 27, 2023
* upstream/master:
  fix(config-loader): defer invalid configuration warning (LunarVim#3869)
  chore: replace deprecated MDI Orbit icon (LunarVim#3880)
  fix: lazy cache (LunarVim#3892)
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