Skip to content

Commit

Permalink
feat: 执行引擎任务调度配额限制 TencentBlueKing#261
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 committed Jun 27, 2024
1 parent 88794d6 commit 47520e5
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Void> script = RedisScript.of(ADD_JOB_LUA_SCRIPT, Void.class);

Expand All @@ -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<Void> script = RedisScript.of(REMOVE_JOB_LUA_SCRIPT, Void.class);

Expand All @@ -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<String> script = RedisScript.of(CHECK_QUOTA_LUA_SCRIPT, String.class);

Expand Down

0 comments on commit 47520e5

Please sign in to comment.