Skip to content

Commit

Permalink
SLE-520 Trigger a sync of the storage after changing the binding
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed Apr 19, 2022
1 parent c60e637 commit 2536779
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
package org.sonarlint.eclipse.core.internal.jobs;

import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
Expand All @@ -40,7 +41,10 @@ public ProjectStorageUpdateJob(String connectionId, String projectKey) {
protected IStatus run(IProgressMonitor monitor) {
try {
var server = SonarLintCorePlugin.getServersManager().findById(connectionId);
server.ifPresent(s -> s.updateProjectStorage(projectKey, null, monitor));
server.ifPresent(s -> {
s.updateProjectStorage(projectKey, null, monitor);
s.sync(Set.of(projectKey), monitor);
});
return Status.OK_STATUS;
} catch (Exception e) {
return new Status(IStatus.ERROR, SonarLintCorePlugin.PLUGIN_ID, "Unable to update SonarLint binding data for project '" + projectKey + "' on '" + connectionId + "'", e);
Expand Down

0 comments on commit 2536779

Please sign in to comment.