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 24, 2024
1 parent 4076f1c commit 9543711
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package com.tencent.bk.job.execute.api.inner;

import com.tencent.bk.job.common.exception.InternalException;
import com.tencent.bk.job.common.model.InternalResponse;
import com.tencent.bk.job.common.resource.quota.ResourceQuotaLimit;
import com.tencent.bk.job.common.service.quota.ResourceQuotaStore;
Expand Down Expand Up @@ -55,10 +56,16 @@ public InternalResponse<Map<String, ResourceQuotaLimit>> getResourceQuotaConfig(

@Override
public InternalResponse<RunningJobQuotaUsage> getRunningJobQuotaUsage() {
RunningJobQuotaUsage runningJobQuotaUsage = new RunningJobQuotaUsage();
runningJobQuotaUsage.setTotal(runningJobResourceQuotaManager.getRunningJobTotal());
runningJobQuotaUsage.setAppCount(runningJobResourceQuotaManager.getAppRunningJobCount());
runningJobQuotaUsage.setResourceScopeCount(runningJobResourceQuotaManager.getResourceScopeRunningJobCount());
return InternalResponse.buildSuccessResp(runningJobQuotaUsage);
try {
RunningJobQuotaUsage runningJobQuotaUsage = new RunningJobQuotaUsage();
runningJobQuotaUsage.setTotal(runningJobResourceQuotaManager.getRunningJobTotal());
runningJobQuotaUsage.setAppCount(runningJobResourceQuotaManager.getAppRunningJobCount());
runningJobQuotaUsage.setResourceScopeCount(runningJobResourceQuotaManager.getResourceScopeRunningJobCount());
return InternalResponse.buildSuccessResp(runningJobQuotaUsage);
} catch (Throwable e) {
log.error("GetRunningJobQuotaUsage error", e);
return InternalResponse.buildCommonFailResp(new InternalException("GetRunningJobQuotaUsage error", e));
}

}
}

0 comments on commit 9543711

Please sign in to comment.