Skip to content

Commit

Permalink
use infrastructure pool instead of forkjoin
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Oct 24, 2024
1 parent c2b8d3f commit d747ede
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/io/cryostat/targets/TargetUpdateJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@

import java.time.Duration;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ForkJoinPool;

import io.cryostat.ConfigProperties;
import io.cryostat.core.net.JFRConnection;
import io.cryostat.libcryostat.JvmIdentifier;
import io.cryostat.recordings.RecordingHelper;

import io.quarkus.narayana.jta.QuarkusTransaction;
import io.smallrye.mutiny.infrastructure.Infrastructure;
import jakarta.inject.Inject;
import jakarta.transaction.Transactional;
import org.eclipse.microprofile.config.inject.ConfigProperty;
Expand All @@ -39,7 +38,6 @@ public class TargetUpdateJob implements Job {
@Inject Logger logger;
@Inject TargetConnectionManager connectionManager;
@Inject RecordingHelper recordingHelper;
ExecutorService executor = ForkJoinPool.commonPool();

@ConfigProperty(name = ConfigProperties.CONNECTIONS_FAILED_TIMEOUT)
Duration connectionTimeout;
Expand All @@ -58,7 +56,8 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
if (targets.size() == 1) {
updateTarget(targets.get(0));
} else {
targets.forEach(t -> executor.submit(() -> updateTargetTx(t.id)));
targets.forEach(
t -> Infrastructure.getDefaultExecutor().execute(() -> updateTargetTx(t.id)));
}
}

Expand Down

0 comments on commit d747ede

Please sign in to comment.