Skip to content

Commit

Permalink
feat: 流水线Job配额管理 TencentBlueKing#5154
Browse files Browse the repository at this point in the history
  • Loading branch information
sawyersong2 committed Sep 16, 2021
1 parent 514c40a commit 8a6f57a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,19 @@ class JobQuotaBusinessService @Autowired constructor(
runningJobs.filter { it?.agentStartTime != null && it.vmType != null }.forEach {
val duration: Duration = Duration.between(it!!.agentStartTime, LocalDateTime.now())
incProjectJobRunningTime(projectId, JobQuotaVmType.parse(it.vmType), duration.toMillis())
LOG.info("<<<Finish time: $projectId|$buildId|$vmSeqId|${JobQuotaVmType.parse(it.vmType)} " +
LOG.info("$projectId|$buildId|$vmSeqId|${JobQuotaVmType.parse(it.vmType)} >> Finish time: " +
"increase ${duration.toHours()} hours. >>>")
}
} else {
LOG.info("<<< DeleteRunningJob get lock failed, not run>>>")
LOG.info("$projectId|$buildId|$vmSeqId >> DeleteRunningJob get lock failed, not run>>>")
}
} catch (e: Throwable) {
LOG.error("DeleteRunningJob exception:", e)
LOG.error("$projectId|$buildId|$vmSeqId >> Job agent finish exception:", e)
} finally {
try {
runningJobsDao.delete(dslContext, projectId, buildId, vmSeqId)
} catch (e: Throwable) {
// do nothing
LOG.error("$projectId|$buildId|$vmSeqId >> DeleteRunningJob exception:", e)
}
redisLock.unlock()
}
Expand Down

0 comments on commit 8a6f57a

Please sign in to comment.