Skip to content

Commit

Permalink
feat: 增加上报时间TencentBlueKing#2136
Browse files Browse the repository at this point in the history
  • Loading branch information
zacYL committed May 15, 2024
1 parent 3d63d4a commit d05da1c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import org.springframework.data.mongodb.core.query.where
import org.springframework.stereotype.Component
import java.time.Duration
import java.time.LocalDate
import java.time.LocalDateTime
import kotlin.reflect.KClass

/**
Expand Down Expand Up @@ -97,6 +98,7 @@ class RepoDetailReport2BkbaseJob(
current: TProjectMetrics
): List<RepoDetail> {
val result = mutableListOf<RepoDetail>()
val reportDate = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0)
current.repoMetrics.forEach {
try {
val repo = RepositoryCommonUtils.getRepositoryDetail(current.projectId, it.repoName)
Expand All @@ -109,7 +111,8 @@ class RepoDetailReport2BkbaseJob(
repoType = it.type,
createdDate = repo.createdDate,
createdBy = repo.createdBy,
quota = repo.quota
quota = repo.quota,
reportDate = reportDate
)
)
} catch (e: RepoNotFoundException) {
Expand All @@ -128,7 +131,8 @@ class RepoDetailReport2BkbaseJob(
var createdDate: String,
var createdBy: String,
var cleanupStrategy: String? = null,
var quota: Long? = null
var quota: Long? = null,
var reportDate: LocalDateTime,
)

companion object {
Expand Down

0 comments on commit d05da1c

Please sign in to comment.