Skip to content

Commit

Permalink
Use constants for query timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Keller committed Sep 17, 2024
1 parent 97d3dec commit 689b848
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -320,7 +321,7 @@ public Set<String> 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<QualifiedName> list(
@Nullable final Set<String> includeTags,
@Nullable final Set<String> excludeTags,
Expand Down

0 comments on commit 689b848

Please sign in to comment.