diff --git a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/quota/limit/RunningJobResourceQuotaManager.java b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/quota/limit/RunningJobResourceQuotaManager.java index 0ee55d6a03..31cda01ba9 100644 --- a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/quota/limit/RunningJobResourceQuotaManager.java +++ b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/quota/limit/RunningJobResourceQuotaManager.java @@ -121,6 +121,9 @@ public RunningJobResourceQuotaManager(StringRedisTemplate redisTemplate, } public void addJob(String appCode, ResourceScope resourceScope, long jobInstanceId) { + if (!runningJobResourceQuotaStore.isQuotaLimitEnabled()) { + return; + } long startTime = System.currentTimeMillis(); RedisScript script = RedisScript.of(ADD_JOB_LUA_SCRIPT, Void.class); @@ -144,6 +147,9 @@ private String convertAppCode(String appCode) { } public void removeJob(String appCode, ResourceScope resourceScope, long jobInstanceId) { + if (!runningJobResourceQuotaStore.isQuotaLimitEnabled()) { + return; + } long startTime = System.currentTimeMillis(); RedisScript script = RedisScript.of(REMOVE_JOB_LUA_SCRIPT, Void.class); @@ -169,6 +175,9 @@ public void removeJob(String appCode, ResourceScope resourceScope, long jobInsta */ public ResourceQuotaCheckResultEnum checkResourceQuotaLimit(String appCode, ResourceScope resourceScope) { + if (!runningJobResourceQuotaStore.isQuotaLimitEnabled()) { + return ResourceQuotaCheckResultEnum.NO_LIMIT; + } long startTime = System.currentTimeMillis(); RedisScript script = RedisScript.of(CHECK_QUOTA_LUA_SCRIPT, String.class);