Browse Source

提交代码,增加错误打印。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.6.1^2
zouap 4 years ago
parent
commit
bf033c1f0f
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      models/user_business_analysis.go

+ 5
- 5
models/user_business_analysis.go View File

@@ -788,7 +788,7 @@ func refreshUserStaticTable(wikiCountMap map[string]int, tableName string, pageS

dateRecordBatch = append(dateRecordBatch, dateRecordAll)
if len(dateRecordBatch) >= BATCH_INSERT_SIZE {
insertTable(dateRecordBatch, tableName, statictisSess)
err := insertTable(dateRecordBatch, tableName, statictisSess)
insertCount += BATCH_INSERT_SIZE
if err != nil {
log.Info("insert all data failed." + err.Error())
@@ -804,7 +804,7 @@ func refreshUserStaticTable(wikiCountMap map[string]int, tableName string, pageS
}
}
if len(dateRecordBatch) > 0 {
insertTable(dateRecordBatch, tableName, statictisSess)
err := insertTable(dateRecordBatch, tableName, statictisSess)
insertCount += len(dateRecordBatch)
if err != nil {
log.Info("insert all data failed." + err.Error())
@@ -835,7 +835,7 @@ func updateUserIndex(tableName string, statictisSess *xorm.Session, userId int64
statictisSess.Exec(updateSql)
}

func insertTable(dateRecords []UserBusinessAnalysisAll, tableName string, statictisSess *xorm.Session) {
func insertTable(dateRecords []UserBusinessAnalysisAll, tableName string, statictisSess *xorm.Session) error {

insertBatchSql := "INSERT INTO public." + tableName +
"(id, count_date, code_merge_count, commit_count, issue_count, comment_count, focus_repo_count, star_repo_count, watched_count, gitea_age_month, commit_code_size, commit_dataset_size, " +
@@ -854,7 +854,8 @@ func insertTable(dateRecords []UserBusinessAnalysisAll, tableName string, static
}
}

statictisSess.Exec(insertBatchSql)
_, err := statictisSess.Exec(insertBatchSql)
return err
}

func RefreshUserStaticAllTabel(wikiCountMap map[string]int, userMetrics map[string]int) {
@@ -2060,7 +2061,6 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s
if cloudTaskRecord.Duration < 100000000 && cloudTaskRecord.Duration > 0 {
setMapKey("CloudBrainRunTime", cloudTaskRecord.UserID, int(cloudTaskRecord.Duration), resultItemMap)
}

if cloudTaskRecord.Type == 1 { //npu
if cloudTaskRecord.JobType == "TRAIN" {
setMapKey("NpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap)


Loading…
Cancel
Save