diff --git a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceResourceQuotaResourceImpl.java b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceResourceQuotaResourceImpl.java index 5c5701840d..22f5bb9ae0 100644 --- a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceResourceQuotaResourceImpl.java +++ b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceResourceQuotaResourceImpl.java @@ -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; @@ -55,10 +56,16 @@ public InternalResponse> getResourceQuotaConfig( @Override public InternalResponse 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)); + } + } }