-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fixed updating the Local Repository caches #502
Fixed updating the Local Repository caches #502
Conversation
Local Repository caches are made to be updated: - (only temporary lemminx-maven build repository) when a MavenProject is built and cached - (all cached) every 30 minutes Also, Diagnostic is made to be re-calculated on finishing of Maven Lemminx Extension initialization
dbdefc1
to
1d81e2b
Compare
Wasn't the local repository searcher already placing a file listener to properly update its cache whenever something changes? |
@mickaelistria we removed the thread wich created a watchservice which updated the cache because the original code tracked only the root .m2/repository. I have fixed that to create a watchservice for children folders but we had a problem which created too many watchservice. To avoid this problem we removed this watchservice. |
OK, got it. And what is used now to detect new content in the Maven repo? I just read about FileAlterationMonitor ( https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/monitor/FileAlterationObserver.html ), would it be capable of being notified recursively? |
For the moment we have no find a solution to evict the cache. Just for your information we have 2 local repo now. The user local repo which is not polluated when user is typing in the editor and à .lemminx-maven repo which is polluated |
OK, please make sure there is an issue, and ideally a test case to demo it, tracking it. This can be an important feature (although not a regression).
OK, sounds good. |
If it is based on watchservice we will have the same problem, because in short watchservice must never used with a lot of directories One idea that we had with @vrubezhny is to provide a thread which evicts the cache per 1 hour |
FileAlterationMonitor does some polling with a given interval. It can be once per hour or every 3 minutes. Polling a file system isn't too heavy. |
We need indeed try it. Thanks @mickaelistria for your suggestion! |
I have created #507 to track this. |
Local Repository caches are made to be updated:
Also, Diagnostic is made to be re-calculated on finishing of Maven Lemminx Extension initialization