Skip to content

Commit

Permalink
【PAC】feat:支持从代码库维度查看对应的代码库事件 #8122
Browse files Browse the repository at this point in the history
  • Loading branch information
mingshewhe committed Oct 28, 2023
1 parent d7c5c4a commit 9081f97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class PipelineTriggerEventDao {
startTime = startTime,
endTime = endTime
)
return dslContext.selectCount().from(t1).leftJoin(t2)
return dslContext.selectCount().from(t2).leftJoin(t1)
.on(t1.EVENT_ID.eq(t2.EVENT_ID)).and(t1.PROJECT_ID.eq(t2.PROJECT_ID))
.where(conditions)
.fetchOne(0, Long::class.java)!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class PipelineTriggerEventService @Autowired constructor(
triggerEvent: PipelineTriggerEvent,
triggerDetail: PipelineTriggerDetail
) {
logger.info("save pipeline trigger event|event[$triggerEvent]|detail[$triggerDetail]")
triggerDetail.detailId = getDetailId()
dslContext.transaction { configuration ->
val transactionContext = DSL.using(configuration)
Expand Down Expand Up @@ -310,9 +309,11 @@ class PipelineTriggerEventService @Autowired constructor(
// 保存重放事件
val requestId = MDC.get(TraceTag.BIZID)
val replayEventId = getEventId()
// 如果重试的事件也由重试产生,则应该记录最开始的请求ID
val replayRequestId = triggerEvent.replayRequestId ?: triggerEvent.requestId
val replayTriggerEvent = with(triggerEvent) {
PipelineTriggerEvent(
requestId = requestId,
requestId = MDC.get(TraceTag.BIZID),
projectId = projectId,
eventId = replayEventId,
triggerType = triggerType,
Expand All @@ -323,8 +324,7 @@ class PipelineTriggerEventService @Autowired constructor(
code = EVENT_REPLAY_DESC,
params = listOf(eventId.toString(), userId)
).toJsonStr(),
// 如果重试的事件也由重试产生,则应该记录最开始的请求ID
replayRequestId = triggerEvent.replayRequestId ?: triggerEvent.requestId,
replayRequestId = replayRequestId,
requestParams = requestParams,
createTime = LocalDateTime.now()
)
Expand Down

0 comments on commit 9081f97

Please sign in to comment.