Merge pull request #14 from johnpoth/timeout

Add cache timeout configuration property. Disabled by default
This commit is contained in:
James Agnew
2019-03-19 10:36:27 -04:00
committed by GitHub
3 changed files with 11 additions and 0 deletions

View File

@@ -89,6 +89,10 @@ public class FhirServerConfigCommon {
Integer maxFetchSize = HapiProperties.getMaximumFetchSize(); Integer maxFetchSize = HapiProperties.getMaximumFetchSize();
retVal.setFetchSizeDefaultMaximum(maxFetchSize); retVal.setFetchSizeDefaultMaximum(maxFetchSize);
ourLog.info("Server configured to have a maximum fetch size of " + (maxFetchSize == Integer.MAX_VALUE? "'unlimited'": maxFetchSize)); ourLog.info("Server configured to have a maximum fetch size of " + (maxFetchSize == Integer.MAX_VALUE? "'unlimited'": maxFetchSize));
Long reuseCachedSearchResultsMillis = HapiProperties.getReuseCachedSearchResultsMillis();
retVal.setReuseCachedSearchResultsForMillis(reuseCachedSearchResultsMillis );
ourLog.info("Server configured to cache search results for {} milliseconds", reuseCachedSearchResultsMillis);
// Subscriptions are enabled by channel type // Subscriptions are enabled by channel type
if (HapiProperties.getSubscriptionRestHookEnabled()) { if (HapiProperties.getSubscriptionRestHookEnabled()) {

View File

@@ -14,6 +14,7 @@ public class HapiProperties {
static final String ALLOW_EXTERNAL_REFERENCES = "allow_external_references"; static final String ALLOW_EXTERNAL_REFERENCES = "allow_external_references";
static final String ALLOW_MULTIPLE_DELETE = "allow_multiple_delete"; static final String ALLOW_MULTIPLE_DELETE = "allow_multiple_delete";
static final String ALLOW_PLACEHOLDER_REFERENCES = "allow_placeholder_references"; static final String ALLOW_PLACEHOLDER_REFERENCES = "allow_placeholder_references";
static final String REUSE_CACHED_SEARCH_RESULTS_MILLIS = "reuse_cached_search_results_millis";
static final String DATASOURCE_DRIVER = "datasource.driver"; static final String DATASOURCE_DRIVER = "datasource.driver";
static final String DATASOURCE_MAX_POOL_SIZE = "datasource.max_pool_size"; static final String DATASOURCE_MAX_POOL_SIZE = "datasource.max_pool_size";
static final String DATASOURCE_PASSWORD = "datasource.password"; static final String DATASOURCE_PASSWORD = "datasource.password";
@@ -327,4 +328,9 @@ public class HapiProperties {
public static String getEmailPassword() { public static String getEmailPassword() {
return HapiProperties.getProperty("email.password"); return HapiProperties.getProperty("email.password");
} }
public static Long getReuseCachedSearchResultsMillis() {
String value = HapiProperties.getProperty(REUSE_CACHED_SEARCH_RESULTS_MILLIS, "-1");
return Long.valueOf(value);
}
} }

View File

@@ -14,6 +14,7 @@ server.base=/fhir
default_encoding=JSON default_encoding=JSON
etag_support=ENABLED etag_support=ENABLED
reuse_cached_search_results_millis=-1
default_page_size=20 default_page_size=20
max_page_size=200 max_page_size=200
allow_override_default_search_params=true allow_override_default_search_params=true