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 955be4b commit ef18279
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class PipelineInfoDao {

fun getPipelineInfo(
dslContext: DSLContext,
projectId: String?,
projectId: String? = null,
pipelineId: String,
channelCode: ChannelCode? = null,
delete: Boolean? = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import java.util.concurrent.Executors

@Suppress("ALL")
@Service
class SyncPipelineProjectIdService @Autowired constructor(
private val dslContext: DSLContext,
Expand Down Expand Up @@ -120,7 +119,11 @@ class SyncPipelineProjectIdService @Autowired constructor(
// 更新流水线Webhook队列表的projectId
pipelineWebhookQueueRecords?.forEach { pipelineWebhookQueue ->
val pipelineId = pipelineWebhookQueue.pipelineId
val pipelineInfo = pipelineInfoDao.getPipelineInfo(dslContext, pipelineId)
val pipelineInfo = pipelineInfoDao.getPipelineInfo(
dslContext = dslContext,
pipelineId = pipelineId,
delete = null
)
if (pipelineInfo != null) {
syncPipelineProjectIdDao.updatePipelineWebhookQueueProject(
dslContext = dslContext,
Expand Down Expand Up @@ -170,7 +173,11 @@ class SyncPipelineProjectIdService @Autowired constructor(
// 更新流水线标签关联关系表的projectId
pipelineLabelPipelineRecords?.forEach { pipelineLabelPipeline ->
val pipelineId = pipelineLabelPipeline.pipelineId
val pipelineInfo = pipelineInfoDao.getPipelineInfo(dslContext, pipelineId)
val pipelineInfo = pipelineInfoDao.getPipelineInfo(
dslContext = dslContext,
pipelineId = pipelineId,
delete = null
)
if (pipelineInfo != null) {
syncPipelineProjectIdDao.updatePipelineLabelPipelineProject(
dslContext = dslContext,
Expand Down

0 comments on commit ef18279

Please sign in to comment.