Skip to content

Commit

Permalink
Add sync by query to run in background to prevent blocking the main t…
Browse files Browse the repository at this point in the history
…hread
  • Loading branch information
marko-bekhta committed Dec 3, 2024
1 parent 3166411 commit 33861ae
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,17 @@ public void registerManagementRoutes(@Observes ManagementInterface mi) {
// syncs only assignee/body, without links comments and transitions
String project = rc.pathParam("project");
String query = rc.queryParam("query").getFirst();
String applyTransitionUpdate = rc.queryParam("applyTransitionUpdate").getFirst();
boolean applyTransitionUpdate = "true".equalsIgnoreCase(rc.queryParam("applyTransitionUpdate").getFirst());

HandlerProjectContext context = contextPerProject.get(project);

if (context == null) {
throw new IllegalArgumentException("Unknown project '%s'".formatted(project));
}

syncByQuery(query, context,
context.submitTask(() -> syncByQuery(query, context,
jiraIssue -> context.submitTask(new JiraIssueSimpleUpsertEventHandler(reportingConfig, context,
jiraIssue, "true".equals(applyTransitionUpdate))));
jiraIssue, applyTransitionUpdate))));
rc.end();
});
mi.router().post("/sync/comments/list").consumes(MediaType.APPLICATION_JSON).blockingHandler(rc -> {
Expand Down

0 comments on commit 33861ae

Please sign in to comment.