diff --git a/cord3c-rest-server/src/main/java/io/cord3c/rest/server/internal/RestServletFactory.java b/cord3c-rest-server/src/main/java/io/cord3c/rest/server/internal/RestServletFactory.java index 8d3268c..63ef7db 100644 --- a/cord3c-rest-server/src/main/java/io/cord3c/rest/server/internal/RestServletFactory.java +++ b/cord3c-rest-server/src/main/java/io/cord3c/rest/server/internal/RestServletFactory.java @@ -75,6 +75,9 @@ protected void initCrnk(CrnkBoot boot) { TransactionRunner transactionRunner = createTransactionRunner(); + boot.setMaxPageLimit(Long.parseLong(PropertyUtils.getProperty("crnk.max-page-limit", "1000"))); + boot.setDefaultPageLimit(Long.parseLong(PropertyUtils.getProperty("crnk.default-page-limit", "20"))); + boot.addModule(new CordaRestModule(serviceHub, cordaMapper)); boot.addModule(HomeModule.create()); boot.addModule(createJpaModule(transactionRunner)); diff --git a/cord3c-rest-server/src/test/java/io/cord3c/rest/server/internal/FlowExecutionRepositoryTest.java b/cord3c-rest-server/src/test/java/io/cord3c/rest/server/internal/FlowExecutionRepositoryTest.java index cba7a66..6536a0d 100644 --- a/cord3c-rest-server/src/test/java/io/cord3c/rest/server/internal/FlowExecutionRepositoryTest.java +++ b/cord3c-rest-server/src/test/java/io/cord3c/rest/server/internal/FlowExecutionRepositoryTest.java @@ -92,22 +92,24 @@ public void test() { assertThat(flow.getCurrentStep()).isEqualTo(FlowExecutionDTO.ENDED_STEP); // garbage collect will not collect - impl.lastGc = Instant.now().minus(Duration.ofHours(1)); + impl.lastGc = Instant.now().plus(Duration.ofHours(1)); impl.checkGc(); assertThat(impl.findAll(querySpec)).hasSize(1); // garbage collect will not collect again - impl.lastGc = Instant.now().minus(Duration.ofHours(1)); + impl.lastGc = Instant.now().plus(Duration.ofHours(1)); impl.checkGc(); assertThat(impl.findAll(querySpec)).hasSize(1); // entry expired, but garbage collection will not run - flow.setLastModified(Instant.now().minus(Duration.ofHours(1))); + impl.lastGc = Instant.now().minus(Duration.ofMillis(5000)); + flow.setLastModified(Instant.now().plus(Duration.ofMillis(5000))); impl.checkGc(); assertThat(impl.findAll(querySpec)).hasSize(1); // garbage collection not run for a long time and will finally collect - impl.lastGc = Instant.now().minus(Duration.ofHours(1)); + impl.lastGc = Instant.now().minus(Duration.ofMillis(5000)); + flow.setLastModified(Instant.now().minus(Duration.ofMillis(5000))); impl.checkGc(); assertThat(impl.findAll(querySpec)).isEmpty(); } diff --git a/gradle.properties b/gradle.properties index 2ca2c33..2a2c6df 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,8 +19,8 @@ CRNK_VERSION=3.3.20200717191406 RMEE_GRADLE_VERSION=1.1.20200614081240 JDK_VERSION=8u202-b08 -#CORDA_VERSION=4.4 -CORDA_VERSION=4.5-C3C01 +CORDA_VERSION=4.4 +#CORDA_VERSION=4.5 CORDA_PLUGINS_VERSION=4.0.45 QUASAR_VERSION=0.7.10. @@ -42,4 +42,4 @@ GRADLE_VERSION=6.1.1 DOCKER_VERSION=19.03.1 KUBERNETES_VERSION=v1.14.0 HELM_VERSION=v3.2.1 -TF_VERSION=0.12.23 \ No newline at end of file +TF_VERSION=0.12.23