Skip to content

Commit

Permalink
bugfix: 取消构建机上班日志的异步处理 TencentBlueKing#4658
Browse files Browse the repository at this point in the history
  • Loading branch information
royalhuang committed Jul 12, 2021
1 parent 30bbea0 commit 23228d3
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,41 @@ class BuildLogPrintResourceImpl @Autowired constructor(
logger.error("Invalid build ID[$buildId]")
return Result(false)
}
return buildLogPrintService.asyncDispatchEvent(LogEvent(buildId, listOf(logMessage)))
buildLogPrintService.dispatchEvent(LogEvent(buildId, listOf(logMessage)))
return Result(true)
}

override fun addRedLogLine(buildId: String, logMessage: LogMessage): Result<Boolean> {
if (buildId.isBlank()) {
logger.error("Invalid build ID[$buildId]")
return Result(false)
}
return buildLogPrintService.asyncDispatchEvent(LogEvent(
buildLogPrintService.dispatchEvent(LogEvent(
buildId = buildId,
logs = listOf(logMessage.copy(message = Ansi().bold().fgRed().a(logMessage.message).reset().toString()))
))
return Result(true)
}

override fun addYellowLogLine(buildId: String, logMessage: LogMessage): Result<Boolean> {
if (buildId.isBlank()) {
logger.error("Invalid build ID[$buildId]")
return Result(false)
}
return buildLogPrintService.asyncDispatchEvent(LogEvent(
buildLogPrintService.dispatchEvent(LogEvent(
buildId = buildId,
logs = listOf(logMessage.copy(message = Ansi().bold().fgYellow().a(logMessage.message).reset().toString()))
))
return Result(true)
}

override fun addLogMultiLine(buildId: String, logMessages: List<LogMessage>): Result<Boolean> {
if (buildId.isBlank()) {
logger.error("Invalid build ID[$buildId]")
return Result(false)
}
return buildLogPrintService.asyncDispatchEvent(LogEvent(buildId, logMessages))
buildLogPrintService.dispatchEvent(LogEvent(buildId, logMessages))
return Result(true)
}

override fun addLogStatus(
Expand Down

0 comments on commit 23228d3

Please sign in to comment.