Skip to content

Commit 33861ae

Browse files
committed
Add sync by query to run in background to prevent blocking the main thread
1 parent 3166411 commit 33861ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/hibernate/infra/replicate/jira/service/jira/JiraService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,17 @@ public void registerManagementRoutes(@Observes ManagementInterface mi) {
228228
// syncs only assignee/body, without links comments and transitions
229229
String project = rc.pathParam("project");
230230
String query = rc.queryParam("query").getFirst();
231-
String applyTransitionUpdate = rc.queryParam("applyTransitionUpdate").getFirst();
231+
boolean applyTransitionUpdate = "true".equalsIgnoreCase(rc.queryParam("applyTransitionUpdate").getFirst());
232232

233233
HandlerProjectContext context = contextPerProject.get(project);
234234

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

239-
syncByQuery(query, context,
239+
context.submitTask(() -> syncByQuery(query, context,
240240
jiraIssue -> context.submitTask(new JiraIssueSimpleUpsertEventHandler(reportingConfig, context,
241-
jiraIssue, "true".equals(applyTransitionUpdate))));
241+
jiraIssue, applyTransitionUpdate))));
242242
rc.end();
243243
});
244244
mi.router().post("/sync/comments/list").consumes(MediaType.APPLICATION_JSON).blockingHandler(rc -> {

0 commit comments

Comments
 (0)