From 909676b2af38c2ab607c1866e02733dd2995b455 Mon Sep 17 00:00:00 2001 From: carlyin <449036249@qq.com> Date: Tue, 19 Oct 2021 20:27:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A1=A8?= =?UTF-8?q?=E5=90=8C=E6=AD=A5projectId=E6=95=B0=E6=8D=AE=20#5339?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../misc/cron/process/PipelineBuildHistoryDataClearJob.kt | 3 ++- .../kotlin/com/tencent/devops/misc/dao/process/ProcessDao.kt | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/cron/process/PipelineBuildHistoryDataClearJob.kt b/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/cron/process/PipelineBuildHistoryDataClearJob.kt index be2f74ad124..22832a97da5 100644 --- a/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/cron/process/PipelineBuildHistoryDataClearJob.kt +++ b/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/cron/process/PipelineBuildHistoryDataClearJob.kt @@ -408,7 +408,8 @@ class PipelineBuildHistoryDataClearJob @Autowired constructor( totalHandleNum = totalHandleNum, handlePageSize = DEFAULT_PAGE_SIZE, isCompletelyDelete = false, - maxStartTime = maxStartTime + maxStartTime = maxStartTime, + geTimeFlag = true ) if (!pipelineHistoryBuildIdList.isNullOrEmpty()) { // 分库路由需要同步T_PIPELINE_BUILD_DETAIL的项目信息(同步完后再删除该逻辑) diff --git a/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/dao/process/ProcessDao.kt b/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/dao/process/ProcessDao.kt index 5da10e1e5d5..1c92de2739c 100644 --- a/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/dao/process/ProcessDao.kt +++ b/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/dao/process/ProcessDao.kt @@ -39,7 +39,6 @@ import com.tencent.devops.model.process.tables.records.TPipelineBuildDetailRecor import com.tencent.devops.model.process.tables.records.TPipelineInfoRecord import com.tencent.devops.model.process.tables.records.TPipelineResourceRecord import com.tencent.devops.model.process.tables.records.TPipelineResourceVersionRecord -import com.tencent.devops.model.process.tables.records.TTemplatePipelineRecord import org.jooq.Condition import org.jooq.DSLContext import org.jooq.Record @@ -158,7 +157,7 @@ class ProcessDao { ): Long { with(TPipelineBuildHistory.T_PIPELINE_BUILD_HISTORY) { val conditions = getQueryBuildHistoryCondition(pipelineId, maxBuildNum, maxStartTime, geTimeFlag) - return dslContext.select(DSL.max(BUILD_NUM)) + return dslContext.selectCount() .from(this) .where(conditions) .fetchOne(0, Long::class.java)!! @@ -206,7 +205,7 @@ class ProcessDao { } else { baseStep.limit(totalHandleNum, handlePageSize) } - return baseStep.fetch() + return baseStep.orderBy(BUILD_ID).fetch() } }