-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add caching to obsidian-list-all-files function #47
Conversation
Hey, thanks for the PR! One question, do you update the cache when creating new notes? |
Hi, thank you for your review! Based on your feedback, I've now adjusted the code so that the cache is also cleared when a note is saved. This ensures that the cache will always be updated when changes are made to the notes. I have committed this change. Please take a look! |
Great! There's another case of new file being created, when following a link to a yet non existent file using |
Does the hook that you add only work in obsidian-mode? Maybe instead of the hook we can just invalidate cache directly? The current way the hook will just stay there, wouldn't it? |
Based on your feedback, I've made adjustments to ensure the cache gets invalidated not only on note creation but also when following a link to a non-existent note etc. I've also addressed the concern about the I've pushed these changes and updated the PR. Please take a look! I'm not fully versed in elisp, so I would really appreciate it if you could review this. |
Sorry for the confusion, I've reconsidered and understand now. This PR modifies |
Great, thank you! I'll add a few final touches and bump the version :) |
This PR adds a caching mechanism to the obsidian-list-all-files function to improve its performance. The function now only scans the Obsidian directory once and subsequently uses the stored result. A new function, obsidian-clear-cache, is introduced to manually clear the cache when necessary.
ref. #39