-
Notifications
You must be signed in to change notification settings - Fork 154
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
SLI-1630 Download project list on background thread #1183
SLI-1630 Download project list on background thread #1183
Conversation
b8c45df
to
2c61425
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just small comments
src/main/java/org/sonarlint/intellij/tasks/ServerDownloadProjectTask.java
Outdated
Show resolved
Hide resolved
} | ||
return computeOnPooledThread("Download Projects", () -> { | ||
try { | ||
return waitForFuture(indicator, getService(BackendService.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to put the computeOnPooledThread
just around the waitForFuture
, inside the try/catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is not that better, ideally the catch should be outside, as it is catching any exception and it returns the error message to the dialog in the Wizard (so that the user can understand). But currently, the computeOnPooledThread is catching any exception as well and just returns null. I think it would be best if we add a new computeOnPooledThreadWithoutCatching, something like that, that would use a custom waitForTask that would throw the exception and not just catch it, so it can go back to the original call.
Probably a similar issue in other xxxTask where we used computeOnPooledThread
src/main/java/org/sonarlint/intellij/tasks/ServerDownloadProjectTask.java
Outdated
Show resolved
Hide resolved
7ff0bde
to
7d80271
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
7d80271
to
2ee3f87
Compare
Quality Gate passedIssues Measures |
SLI-1630