Skip to content

Commit

Permalink
Increase timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdpopov committed Sep 17, 2020
1 parent 300c067 commit 3c1b575
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"env": [
{ "name": "JAVA_OPTIONS",
"value": "-XX:MaxRAMPercentage=66.0"
"value": "-XX:MaxRAMPercentage=66.0 -Drequest_timeout_ms=7200000"
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/folio/edge/oaipmh/MainVerticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public class MainVerticle extends EdgeVerticle2 {
public Router defineRoutes() {
String okapiURL = config().getString(SYS_OKAPI_URL);
int reqTimeoutMs = config().getInteger(SYS_REQUEST_TIMEOUT_MS);
// first call to mod-oai-pmh is supposed to take significant time
// if the timeout is not set via env vars, it will be 2 hours
if (reqTimeoutMs == Constants.DEFAULT_REQUEST_TIMEOUT_MS) {
reqTimeoutMs = 7200000;
}

OaiPmhOkapiClientFactory ocf = new OaiPmhOkapiClientFactory(vertx, okapiURL, reqTimeoutMs);
OaiPmhHandler oaiPmhHandler = new OaiPmhHandler(secureStore, ocf);

Expand Down

0 comments on commit 3c1b575

Please sign in to comment.