From 689b84838b73fb2724aa8c3c52f614192a667ddf Mon Sep 17 00:00:00 2001 From: Bryan Keller Date: Tue, 17 Sep 2024 07:01:54 -0700 Subject: [PATCH] Use constants for query timeouts --- .../metacat/common/server/properties/UserMetadata.java | 6 +++++- .../com/netflix/metacat/metadata/mysql/MySqlTagService.java | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/metacat-common-server/src/main/java/com/netflix/metacat/common/server/properties/UserMetadata.java b/metacat-common-server/src/main/java/com/netflix/metacat/common/server/properties/UserMetadata.java index 6c6a13927..c23bad9ab 100644 --- a/metacat-common-server/src/main/java/com/netflix/metacat/common/server/properties/UserMetadata.java +++ b/metacat-common-server/src/main/java/com/netflix/metacat/common/server/properties/UserMetadata.java @@ -28,9 +28,13 @@ */ @Data public class UserMetadata { + + public static final int QUERY_TIMEOUT_IN_SEC = 60; + public static final int LONG_QUERY_TIMEOUT_IN_SEC = 120; + @NonNull private Config config = new Config(); - private int queryTimeoutInSeconds = 60; + private int queryTimeoutInSeconds = QUERY_TIMEOUT_IN_SEC; /** * config related properties. diff --git a/metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlTagService.java b/metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlTagService.java index f8d039f34..d152991f9 100644 --- a/metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlTagService.java +++ b/metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlTagService.java @@ -23,6 +23,7 @@ import com.netflix.metacat.common.server.model.Lookup; import com.netflix.metacat.common.server.model.TagItem; import com.netflix.metacat.common.server.properties.Config; +import com.netflix.metacat.common.server.properties.UserMetadata; import com.netflix.metacat.common.server.usermetadata.LookupService; import com.netflix.metacat.common.server.usermetadata.TagService; import com.netflix.metacat.common.server.usermetadata.UserMetadataService; @@ -320,7 +321,7 @@ public Set getTags() { * @return list of qualified names of the items */ @Override - @Transactional(readOnly = true, timeout = 120) + @Transactional(readOnly = true, timeout = UserMetadata.LONG_QUERY_TIMEOUT_IN_SEC) public List list( @Nullable final Set includeTags, @Nullable final Set excludeTags,