Skip to content

Commit

Permalink
Extract Constant in LimitType (alibaba#8587)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenhao26-nineteen authored Jun 20, 2022
1 parent b53827b commit 7a3757c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;

import static com.alibaba.nacos.config.server.constant.Constants.LIMIT_ERROR_CODE;

/**
* Capacity management aspect: batch write and update but don't process it.
*
Expand Down Expand Up @@ -427,10 +429,10 @@ public enum LimitType {
/**
* over limit.
*/
OVER_CLUSTER_QUOTA("超过集群配置个数上限", 429),
OVER_GROUP_QUOTA("超过该Group配置个数上限", 429),
OVER_TENANT_QUOTA("超过该租户配置个数上限", 429),
OVER_MAX_SIZE("超过配置的内容大小上限", 429);
OVER_CLUSTER_QUOTA("超过集群配置个数上限", LIMIT_ERROR_CODE),
OVER_GROUP_QUOTA("超过该Group配置个数上限", LIMIT_ERROR_CODE),
OVER_TENANT_QUOTA("超过该租户配置个数上限", LIMIT_ERROR_CODE),
OVER_MAX_SIZE("超过配置的内容大小上限", LIMIT_ERROR_CODE);

public final String description;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,6 @@ public class Constants {
public static final String CONFIG_EXPORT_METADATA = ".meta.yml";

public static final String CONFIG_EXPORT_METADATA_NEW = ".metadata.yml";

public static final int LIMIT_ERROR_CODE = 429;
}

0 comments on commit 7a3757c

Please sign in to comment.