-
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-1816 Interrupting the branch matching computation should not cause an error #1292
SLI-1816 Interrupting the branch matching computation should not cause an error #1292
Conversation
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.
I think we should just catch the interruption at the future level, not the whole method
ea3f744
to
63ff89d
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
63ff89d
to
5c8b7e6
Compare
5c8b7e6
to
ae7b7ce
Compare
} | ||
}) | ||
return computeOnPooledThread(project, "Waiting for branch matching result") { resultFuture.get() } | ||
return computeOnPooledThread(project, "Waiting for branch matching result") { | ||
try { |
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.
I don't think you need this try/catch here?
@@ -644,11 +649,27 @@ object SonarLintIntelliJClient : SonarLintRpcClientDelegate { | |||
PerformInBackgroundOption.ALWAYS_BACKGROUND | |||
) { | |||
override fun run(indicator: ProgressIndicator) { | |||
val result = repo.electBestMatchingServerBranchForCurrentHead(mainBranchName, allBranchesNames) ?: mainBranchName | |||
resultFuture.complete(result) | |||
try { |
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.
I think you can reuse FutureUtils.waitForTask
, it seems very similar
Quality Gate passedIssues Measures |
SLI-1816