diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 6d438ab0a7..ec9cf25fee 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -1112,7 +1112,7 @@ func setUserMetrics(userMetrics map[string]int, user *User, start_time int64, en //HasActivityUser int `xorm:"NOT NULL DEFAULT 0"` //TotalActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"` //TotalHasActivityUser - regist_time := user.CreatedUnix.AsTime().Unix() + regist_time := int64(user.CreatedUnix) if regist_time >= start_time && regist_time <= end_time { if user.IsActive { userMetrics["ActivateRegistUser"] = getMapKeyStringValue("ActivateRegistUser", userMetrics) + 1 @@ -2049,7 +2049,7 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s var indexTotal int64 indexTotal = 0 for { - sess.Select("id,job_type,user_id,duration,train_job_duration,type").Table("cloudbrain").Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) + sess.Select("id,job_type,user_id,duration,train_job_duration,type").Table("cloudbrain").Unscoped().Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) cloudTaskList := make([]*Cloudbrain, 0) sess.Find(&cloudTaskList) log.Info("query cloudbrain size=" + fmt.Sprint(len(cloudTaskList))) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index aa52a1400c..dc2c417e4d 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -902,16 +902,17 @@ func CompleteMultipart(ctx *context.Context) { if err != nil { log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error()) } else { - attachment.DecompressState = models.DecompressStateIng - err = models.UpdateAttachment(attachment) - if err != nil { - log.Error("UpdateAttachment state(%s) failed:%s", uuid, err.Error()) - } + updateAttachmentDecompressStateIng(attachment) } } if typeCloudBrain == models.TypeCloudBrainTwo { attachjson, _ := json.Marshal(attachment) - labelmsg.SendDecompressAttachToLabelOBS(string(attachjson)) + err = labelmsg.SendDecompressAttachToLabelOBS(string(attachjson)) + if err != nil { + log.Error("SendDecompressTask to labelsystem (%s) failed:%s", attachment.UUID, err.Error()) + } else { + updateAttachmentDecompressStateIng(attachment) + } } } else { var labelMap map[string]string diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index 1c79c9e938..207727af18 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -691,8 +691,11 @@ func TimingCountDataByDateAndReCount(date string, isReCount bool) { t, _ := time.Parse("2006-01-02", date) startTime := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location()) - + startTime = startTime.UTC() endTime := time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 0, t.Location()) + endTime = endTime.UTC() + log.Info("startTime time:" + startTime.Format("2006-01-02 15:04:05")) + log.Info("endTime time:" + endTime.Format("2006-01-02 15:04:05")) warnEmailMessage := "用户统计信息入库失败,请尽快定位。" //query wiki data log.Info("start to time count data")