Skip to content

Commit

Permalink
feat:数据库表同步projectId数据 TencentBlueKing#5339
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Oct 19, 2021
1 parent e474c23 commit 909676b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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的项目信息(同步完后再删除该逻辑)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)!!
Expand Down Expand Up @@ -206,7 +205,7 @@ class ProcessDao {
} else {
baseStep.limit(totalHandleNum, handlePageSize)
}
return baseStep.fetch()
return baseStep.orderBy(BUILD_ID).fetch()
}
}

Expand Down

0 comments on commit 909676b

Please sign in to comment.