Changeset 4629 for branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs
- Timestamp:
- 10/20/10 15:05:55 (14 years ago)
- Location:
- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 *.user
-
- Property svn:ignore
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs
r4615 r4629 58 58 orderby ar.Job.Priority descending 59 59 select Convert.ToDto(ar.Job); 60 return query.ToArray(); 60 return query; 61 } 62 63 public IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave) { 64 var query = from j in db.Jobs 65 where j.JobState == JobState.Waiting && j.CoresNeeded <= slave.FreeCores && j.MemoryNeeded <= slave.FreeMemory 66 orderby j.Priority descending 67 select Convert.ToDto(j); 68 return query.Union(GetAvailableParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray(); 61 69 } 62 70 #endregion … … 217 225 public bool IsUserAuthorizedForJobs(Guid userId, params Guid[] jobIds) { 218 226 var userIds = from job in db.Jobs // this needs to be fast! 219 where jobIds.Contains(job.JobId)220 select job.UserId;227 where jobIds.Contains(job.JobId) 228 select job.UserId; 221 229 return userIds.All(x => x == userId); 222 230 }
Note: See TracChangeset
for help on using the changeset viewer.