|
|
|
@@ -62,19 +62,20 @@ func (datasets DatasetList) loadAttributes(e Engine) error { |
|
|
|
} |
|
|
|
|
|
|
|
set := make(map[int64]struct{}) |
|
|
|
userIdSet := make(map[int64]struct{}) |
|
|
|
datasetIDs := make([]int64, len(datasets)) |
|
|
|
for i := range datasets { |
|
|
|
set[datasets[i].UserID] = struct{}{} |
|
|
|
userIdSet[datasets[i].UserID] = struct{}{} |
|
|
|
set[datasets[i].RepoID] = struct{}{} |
|
|
|
datasetIDs[i] = datasets[i].ID |
|
|
|
} |
|
|
|
|
|
|
|
// Load owners. |
|
|
|
users := make(map[int64]*User, len(set)) |
|
|
|
users := make(map[int64]*User, len(userIdSet)) |
|
|
|
repos := make(map[int64]*Repository, len(set)) |
|
|
|
if err := e. |
|
|
|
Where("id > 0"). |
|
|
|
In("id", keysInt64(set)). |
|
|
|
In("id", keysInt64(userIdSet)). |
|
|
|
Find(&users); err != nil { |
|
|
|
return fmt.Errorf("find users: %v", err) |
|
|
|
} |
|
|
|
|