Skip to content

Commit

Permalink
Attempt to inject jersey-background-task-scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Nov 29, 2024
1 parent 54795d3 commit 938da41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/atomgraph/linkeddatahub/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
import com.github.jsonldjava.core.DocumentLoader;
import com.github.jsonldjava.core.JsonLdOptions;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import java.io.FileOutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -237,6 +238,7 @@
import org.glassfish.jersey.client.RequestEntityProcessing;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.process.internal.RequestScoped;
import org.glassfish.jersey.server.BackgroundScheduler;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.filter.HttpMethodOverrideFilter;

Expand All @@ -252,7 +254,7 @@ public class Application extends ResourceConfig

private static final Logger log = LoggerFactory.getLogger(Application.class);

private @Inject ScheduledExecutorService idleConnectionMonitor;
private @Inject @BackgroundScheduler @Named("jersey-background-task-scheduler") ScheduledExecutorService idleConnectionMonitor;
private final ExecutorService importThreadPool;
private final ServletConfig servletConfig;
private final EventBus eventBus = new EventBus();
Expand Down Expand Up @@ -1494,7 +1496,7 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje
config.property(ClientProperties.FOLLOW_REDIRECTS, true);
config.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.BUFFERED); // https://stackoverflow.com/questions/42139436/jersey-client-throws-cannot-retry-request-with-a-non-repeatable-request-entity
config.property(ApacheClientProperties.CONNECTION_MANAGER, conman);

return ClientBuilder.newBuilder().
withConfig(config).
sslContext(ctx).
Expand Down

0 comments on commit 938da41

Please sign in to comment.