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

SLI-1630 Download project list on background thread #1183

Conversation

eray-felek-sonarsource
Copy link
Contributor

@eray-felek-sonarsource eray-felek-sonarsource commented Sep 27, 2024

@eray-felek-sonarsource eray-felek-sonarsource marked this pull request as ready for review September 27, 2024 13:08
@eray-felek-sonarsource eray-felek-sonarsource force-pushed the feature/ef/SLI-1630-download-project-list-background branch 2 times, most recently from b8c45df to 2c61425 Compare September 27, 2024 14:23
Copy link
Member

@nquinquenel nquinquenel left a 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

}
return computeOnPooledThread("Download Projects", () -> {
try {
return waitForFuture(indicator, getService(BackendService.class)
Copy link
Member

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

Copy link
Member

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

@eray-felek-sonarsource eray-felek-sonarsource force-pushed the feature/ef/SLI-1630-download-project-list-background branch 2 times, most recently from 7ff0bde to 7d80271 Compare September 30, 2024 08:52
Copy link
Member

@nquinquenel nquinquenel left a comment

Choose a reason for hiding this comment

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

LGTM

@eray-felek-sonarsource eray-felek-sonarsource force-pushed the feature/ef/SLI-1630-download-project-list-background branch from 7d80271 to 2ee3f87 Compare September 30, 2024 09:21
@eray-felek-sonarsource eray-felek-sonarsource merged commit be690c9 into master Sep 30, 2024
29 checks passed
@eray-felek-sonarsource eray-felek-sonarsource deleted the feature/ef/SLI-1630-download-project-list-background branch September 30, 2024 10:46
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.

2 participants