- Timestamp:
- 06/17/13 11:51:20 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HivePerformance/sources/HeuristicLab.Services.Hive/3.3/OptimizedHiveDao.cs
r9634 r9635 56 56 57 57 private static readonly Func<HiveDataContext, Guid, IQueryable<Tuple<Task, Guid?>>> GetTaskByIdAndLastStateLogSlaveIdQuery = CompiledQuery.Compile((HiveDataContext db, Guid taskId) => 58 from t in db.Tasks 59 join sl in db.StateLogs on t.TaskId equals sl.TaskId 60 where t.TaskId == taskId 61 orderby sl.DateTime descending 62 group sl by t into logs 63 select new Tuple<Task, Guid?>(logs.Key, logs.First().SlaveId) 58 from t in db.Tasks 59 let lastStateLog = t.StateLogs.OrderByDescending(sl => sl.DateTime).FirstOrDefault() 60 where t.TaskId == taskId 61 select new Tuple<Task, Guid?>(t, lastStateLog != null ? lastStateLog.SlaveId : null) 64 62 ); 65 63 … … 100 98 ExecutionTime = TimeSpan.FromMilliseconds(task.ExecutionTimeMs), 101 99 ParentTaskId = task.ParentTaskId, 102 StateLog = task.StateLogs. Select(sl => ConvertStateLog(sl)).ToList(),100 StateLog = task.StateLogs.OrderBy(sl => sl.DateTime).Select(sl => ConvertStateLog(sl)).ToList(), 103 101 State = ConvertTaskState(task.State), 104 102 Command = ConvertCommand(task.Command),
Note: See TracChangeset
for help on using the changeset viewer.