| @@ -1112,7 +1112,7 @@ func setUserMetrics(userMetrics map[string]int, user *User, start_time int64, en | |||||
| //HasActivityUser int `xorm:"NOT NULL DEFAULT 0"` | //HasActivityUser int `xorm:"NOT NULL DEFAULT 0"` | ||||
| //TotalActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"` | //TotalActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"` | ||||
| //TotalHasActivityUser | //TotalHasActivityUser | ||||
| regist_time := user.CreatedUnix.AsTime().Unix() | |||||
| regist_time := int64(user.CreatedUnix) | |||||
| if regist_time >= start_time && regist_time <= end_time { | if regist_time >= start_time && regist_time <= end_time { | ||||
| if user.IsActive { | if user.IsActive { | ||||
| userMetrics["ActivateRegistUser"] = getMapKeyStringValue("ActivateRegistUser", userMetrics) + 1 | 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 | var indexTotal int64 | ||||
| indexTotal = 0 | indexTotal = 0 | ||||
| for { | 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) | cloudTaskList := make([]*Cloudbrain, 0) | ||||
| sess.Find(&cloudTaskList) | sess.Find(&cloudTaskList) | ||||
| log.Info("query cloudbrain size=" + fmt.Sprint(len(cloudTaskList))) | log.Info("query cloudbrain size=" + fmt.Sprint(len(cloudTaskList))) | ||||
| @@ -902,16 +902,17 @@ func CompleteMultipart(ctx *context.Context) { | |||||
| if err != nil { | if err != nil { | ||||
| log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error()) | log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error()) | ||||
| } else { | } 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 { | if typeCloudBrain == models.TypeCloudBrainTwo { | ||||
| attachjson, _ := json.Marshal(attachment) | 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 { | } else { | ||||
| var labelMap map[string]string | var labelMap map[string]string | ||||
| @@ -691,8 +691,11 @@ func TimingCountDataByDateAndReCount(date string, isReCount bool) { | |||||
| t, _ := time.Parse("2006-01-02", date) | t, _ := time.Parse("2006-01-02", date) | ||||
| startTime := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location()) | 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 := 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 := "用户统计信息入库失败,请尽快定位。" | warnEmailMessage := "用户统计信息入库失败,请尽快定位。" | ||||
| //query wiki data | //query wiki data | ||||
| log.Info("start to time count data") | log.Info("start to time count data") | ||||
| @@ -3923,7 +3923,7 @@ function initVueDataset() { | |||||
| this.getTypeList() | this.getTypeList() | ||||
| if (!!document.getElementById('dataset-repolink-init')) { | if (!!document.getElementById('dataset-repolink-init')) { | ||||
| this.cloudbrainType = location.href.indexOf('cloudbrain/train-job/create') !== -1 ? 0 : 1 | |||||
| this.cloudbrainType = location.href.indexOf('cloudbrain') !== -1 ? 0 : 1 | |||||
| this.getCurrentRepoDataset(this.repolink, this.cloudbrainType) | this.getCurrentRepoDataset(this.repolink, this.cloudbrainType) | ||||
| } | } | ||||