Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import eu.knowledge.engine.smartconnector.api.SmartConnector;
import eu.knowledge.engine.smartconnector.api.SmartConnectorConfig;
import eu.knowledge.engine.smartconnector.impl.SmartConnectorBuilder;
import eu.knowledge.engine.smartconnector.impl.SmartConnectorImpl;
import jakarta.ws.rs.container.AsyncResponse;
import jakarta.ws.rs.core.Response;

Expand Down Expand Up @@ -236,6 +235,10 @@ protected boolean removeEldestEntry(Map.Entry<Integer, HandleRequest> eldest) {

if (scModel.getReasonerLevel() != null)
this.sc.setReasonerLevel(scModel.getReasonerLevel());

Runtime.getRuntime().addShutdownHook(new Thread(() -> {
this.stop();
}));
}

protected void tryProcessHandleRequestElseEnqueue(HandleRequest handleRequest) {
Expand Down Expand Up @@ -728,7 +731,7 @@ private void cancelAsyncResponse() {
var response = new ResponseMessage();
response.setMessageType("message");
response.setMessage(
"This long polling request is cancelled by the server because the Knowledge Base is stopping.");
"This long polling request is cancelled by the server because it or the Knowledge Base is stopping. Do not reinitiate this request.");
boolean cancelledSucceeded = this.asyncResponse.resume(Response.status(410).entity(response).build());

if (!cancelledSucceeded) {
Expand Down
Loading