Browse Source

fix-3354

tags/v1.22.12.2^2
ychao_1983 2 years ago
parent
commit
03ff1f6ede
2 changed files with 19 additions and 18 deletions
  1. +18
    -17
      modules/setting/setting.go
  2. +1
    -1
      routers/repo/repo_statistic.go

+ 18
- 17
modules/setting/setting.go View File

@@ -519,7 +519,6 @@ var (
CullIdleTimeout string CullIdleTimeout string
CullInterval string CullInterval string



//benchmark config //benchmark config
IsBenchmarkEnabled bool IsBenchmarkEnabled bool
BenchmarkOwner string BenchmarkOwner string
@@ -617,14 +616,14 @@ var (
UsageRateBeginTime string UsageRateBeginTime string
}{} }{}


ClearStrategy= struct {
Enabled bool
ResultSaveDays int
BatchSize int
DebugJobSize int
TrashSaveDays int
Cron string
RunAtStart bool
ClearStrategy = struct {
Enabled bool
ResultSaveDays int
BatchSize int
DebugJobSize int
TrashSaveDays int
Cron string
RunAtStart bool
}{} }{}


C2NetInfos *C2NetSqInfos C2NetInfos *C2NetSqInfos
@@ -711,6 +710,7 @@ var (


ProjectHealth float64 ProjectHealth float64
ProjectHealthIssueCompleteRatio float64 ProjectHealthIssueCompleteRatio float64
ProjectHealth0IssueCloseRatio float64


TeamHealth float64 TeamHealth float64
TeamHealthContributors float64 TeamHealthContributors float64
@@ -1705,16 +1705,16 @@ func getModelartsCDConfig() {
getNotebookFlavorInfos() getNotebookFlavorInfos()
} }


func getClearStrategy(){
func getClearStrategy() {


sec := Cfg.Section("clear_strategy") sec := Cfg.Section("clear_strategy")
ClearStrategy.Enabled=sec.Key("ENABLED").MustBool(false)
ClearStrategy.ResultSaveDays=sec.Key("RESULT_SAVE_DAYS").MustInt(30)
ClearStrategy.BatchSize=sec.Key("BATCH_SIZE").MustInt(500)
ClearStrategy.DebugJobSize=sec.Key("DEBUG_BATCH_SIZE").MustInt(100)
ClearStrategy.TrashSaveDays=sec.Key("TRASH_SAVE_DAYS").MustInt(90)
ClearStrategy.Cron=sec.Key("CRON").MustString("* 0,30 2-8 * * ?")
ClearStrategy.RunAtStart=sec.Key("RUN_AT_START").MustBool(false)
ClearStrategy.Enabled = sec.Key("ENABLED").MustBool(false)
ClearStrategy.ResultSaveDays = sec.Key("RESULT_SAVE_DAYS").MustInt(30)
ClearStrategy.BatchSize = sec.Key("BATCH_SIZE").MustInt(500)
ClearStrategy.DebugJobSize = sec.Key("DEBUG_BATCH_SIZE").MustInt(100)
ClearStrategy.TrashSaveDays = sec.Key("TRASH_SAVE_DAYS").MustInt(90)
ClearStrategy.Cron = sec.Key("CRON").MustString("* 0,30 2-8 * * ?")
ClearStrategy.RunAtStart = sec.Key("RUN_AT_START").MustBool(false)
} }


func getGrampusConfig() { func getGrampusConfig() {
@@ -1781,6 +1781,7 @@ func SetRadarMapConfig() {
RadarMap.LivenessRelease = sec.Key("liveness_release").MustFloat64(0.4) RadarMap.LivenessRelease = sec.Key("liveness_release").MustFloat64(0.4)
RadarMap.ProjectHealth = sec.Key("project_health").MustFloat64(0.1) RadarMap.ProjectHealth = sec.Key("project_health").MustFloat64(0.1)
RadarMap.ProjectHealthIssueCompleteRatio = sec.Key("project_health_issue_complete_ratio").MustFloat64(100) RadarMap.ProjectHealthIssueCompleteRatio = sec.Key("project_health_issue_complete_ratio").MustFloat64(100)
RadarMap.ProjectHealth0IssueCloseRatio = sec.Key("project_health_0_issue_close_ratio").MustFloat64(0.0)
RadarMap.TeamHealth = sec.Key("team_health").MustFloat64(0.1) RadarMap.TeamHealth = sec.Key("team_health").MustFloat64(0.1)
RadarMap.TeamHealthContributors = sec.Key("team_health_contributors").MustFloat64(0.2) RadarMap.TeamHealthContributors = sec.Key("team_health_contributors").MustFloat64(0.2)
RadarMap.TeamHealthKeyContributors = sec.Key("team_health_key_contributors").MustFloat64(0.6) RadarMap.TeamHealthKeyContributors = sec.Key("team_health_key_contributors").MustFloat64(0.6)


+ 1
- 1
routers/repo/repo_statistic.go View File

@@ -75,7 +75,7 @@ func RepoStatisticDaily(date string) {
if repo.NumIssues != 0 { if repo.NumIssues != 0 {
issueFixedRate = float32(repo.NumClosedIssues) / float32(repo.NumIssues) issueFixedRate = float32(repo.NumClosedIssues) / float32(repo.NumIssues)
} else { } else {
issueFixedRate = 1.0
issueFixedRate = float32(setting.RadarMap.ProjectHealth0IssueCloseRatio)
} }


var numVersions int64 var numVersions int64


Loading…
Cancel
Save