Add property for cached search result timeout
This commit is contained in:
@@ -105,6 +105,9 @@ public class FhirServerConfigCommon {
|
|||||||
retVal.setReuseCachedSearchResultsForMillis(reuseCachedSearchResultsMillis);
|
retVal.setReuseCachedSearchResultsForMillis(reuseCachedSearchResultsMillis);
|
||||||
ourLog.info("Server configured to cache search results for {} milliseconds", reuseCachedSearchResultsMillis);
|
ourLog.info("Server configured to cache search results for {} milliseconds", reuseCachedSearchResultsMillis);
|
||||||
|
|
||||||
|
Long retainCachedSearchesMinutes = HapiProperties.getExpireSearchResultsAfterMins();
|
||||||
|
retVal.setExpireSearchResultsAfterMillis(retainCachedSearchesMinutes * 60 * 1000);
|
||||||
|
|
||||||
// Subscriptions are enabled by channel type
|
// Subscriptions are enabled by channel type
|
||||||
if (HapiProperties.getSubscriptionRestHookEnabled()) {
|
if (HapiProperties.getSubscriptionRestHookEnabled()) {
|
||||||
ourLog.info("Enabling REST-hook subscriptions");
|
ourLog.info("Enabling REST-hook subscriptions");
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import java.util.stream.Collectors;
|
|||||||
import static org.apache.commons.lang3.StringUtils.*;
|
import static org.apache.commons.lang3.StringUtils.*;
|
||||||
|
|
||||||
public class HapiProperties {
|
public class HapiProperties {
|
||||||
static final String ENABLE_INDEX_MISSING_FIELDS = "enable_index_missing_fields";
|
static final String ENABLE_INDEX_MISSING_FIELDS = "enable_index_missing_fields";
|
||||||
static final String AUTO_CREATE_PLACEHOLDER_REFERENCE_TARGETS = "auto_create_placeholder_reference_targets";
|
static final String AUTO_CREATE_PLACEHOLDER_REFERENCE_TARGETS = "auto_create_placeholder_reference_targets";
|
||||||
static final String ENFORCE_REFERENTIAL_INTEGRITY_ON_WRITE = "enforce_referential_integrity_on_write";
|
static final String ENFORCE_REFERENTIAL_INTEGRITY_ON_WRITE = "enforce_referential_integrity_on_write";
|
||||||
static final String ENFORCE_REFERENTIAL_INTEGRITY_ON_DELETE = "enforce_referential_integrity_on_delete";
|
static final String ENFORCE_REFERENTIAL_INTEGRITY_ON_DELETE = "enforce_referential_integrity_on_delete";
|
||||||
@@ -67,7 +67,8 @@ public class HapiProperties {
|
|||||||
private static final String FILTER_SEARCH_ENABLED = "filter_search.enabled";
|
private static final String FILTER_SEARCH_ENABLED = "filter_search.enabled";
|
||||||
private static final String GRAPHQL_ENABLED = "graphql.enabled";
|
private static final String GRAPHQL_ENABLED = "graphql.enabled";
|
||||||
private static final String BULK_EXPORT_ENABLED = "bulk.export.enabled";
|
private static final String BULK_EXPORT_ENABLED = "bulk.export.enabled";
|
||||||
private static Properties ourProperties;
|
public static final String EXPIRE_SEARCH_RESULTS_AFTER_MINS = "retain_cached_searches_mins";
|
||||||
|
private static Properties ourProperties;
|
||||||
|
|
||||||
public static boolean isElasticSearchEnabled() {
|
public static boolean isElasticSearchEnabled() {
|
||||||
return HapiProperties.getPropertyBoolean("elasticsearch.enabled", false);
|
return HapiProperties.getPropertyBoolean("elasticsearch.enabled", false);
|
||||||
@@ -395,10 +396,15 @@ public class HapiProperties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Long getReuseCachedSearchResultsMillis() {
|
public static Long getReuseCachedSearchResultsMillis() {
|
||||||
String value = HapiProperties.getProperty(REUSE_CACHED_SEARCH_RESULTS_MILLIS, "-1");
|
String value = HapiProperties.getProperty(REUSE_CACHED_SEARCH_RESULTS_MILLIS, "60000");
|
||||||
return Long.valueOf(value);
|
return Long.valueOf(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Long getExpireSearchResultsAfterMins() {
|
||||||
|
String value = HapiProperties.getProperty(EXPIRE_SEARCH_RESULTS_AFTER_MINS, "60");
|
||||||
|
return Long.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
public static Boolean getCorsAllowedCredentials() {
|
public static Boolean getCorsAllowedCredentials() {
|
||||||
return HapiProperties.getBooleanProperty(CORS_ALLOW_CREDENTIALS, false);
|
return HapiProperties.getBooleanProperty(CORS_ALLOW_CREDENTIALS, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ enforce_referential_integrity_on_write=false
|
|||||||
enforce_referential_integrity_on_delete=false
|
enforce_referential_integrity_on_delete=false
|
||||||
default_encoding=JSON
|
default_encoding=JSON
|
||||||
etag_support=ENABLED
|
etag_support=ENABLED
|
||||||
reuse_cached_search_results_millis=-1
|
reuse_cached_search_results_millis=60000
|
||||||
|
retain_cached_searches_mins=60
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user