| @@ -61,7 +61,7 @@ func Accomplish(action models.Action) { | |||||
| actions = append(actions, models.Action{ | actions = append(actions, models.Action{ | ||||
| ID: action.ID, | ID: action.ID, | ||||
| OpType: models.ActionDatasetRecommended, | OpType: models.ActionDatasetRecommended, | ||||
| ActUserID: action.UserID, | |||||
| ActUserID: action.ActUserID, | |||||
| UserID: user.ID, | UserID: user.ID, | ||||
| RepoID: action.RepoID, | RepoID: action.RepoID, | ||||
| Content: action.Content, | Content: action.Content, | ||||
| @@ -85,7 +85,11 @@ func accomplish(action models.Action, taskType models.TaskType) error { | |||||
| log.Error("PANIC:%v", combinedErr) | log.Error("PANIC:%v", combinedErr) | ||||
| } | } | ||||
| }() | }() | ||||
| log.Info("accomplish start. actionId=%d userId= %d", action.ID, action.UserID) | |||||
| userId := action.UserID | userId := action.UserID | ||||
| if !isUserAvailable(userId) { | |||||
| return nil | |||||
| } | |||||
| //get task config | //get task config | ||||
| config, err := GetTaskConfig(string(taskType)) | config, err := GetTaskConfig(string(taskType)) | ||||
| @@ -143,3 +147,17 @@ func isLimited(userId int64, config *models.TaskConfig, rejectPolicy models.Limi | |||||
| return false | return false | ||||
| } | } | ||||
| func isUserAvailable(userId int64) bool { | |||||
| if userId < 1 { | |||||
| return false | |||||
| } | |||||
| user, err := models.GetUserByID(userId) | |||||
| if err != nil || user == nil { | |||||
| return false | |||||
| } | |||||
| if user.IsOrganization() { | |||||
| return false | |||||
| } | |||||
| return true | |||||
| } | |||||