Changeset 15643 for branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs
- Timestamp:
- 01/23/18 15:42:13 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs
r15630 r15643 45 45 } 46 46 47 public IEnumerable<Job> GetJobsReadyForDeletion() { 48 return GetJobsReadyForDeletionQuery(DataContext); 49 } 50 47 51 48 52 #region Compiled queries … … 62 66 where job.State == jobState 63 67 select job.JobId).ToList()); 68 private static readonly Func<DataContext, IEnumerable<Job>> GetJobsReadyForDeletionQuery = 69 CompiledQuery.Compile((DataContext db) => 70 (from job in db.GetTable<Job>() 71 where job.State == JobState.StatisticsPending 72 && (from task in db.GetTable<Task>() 73 where task.JobId == job.JobId 74 select task.State == TaskState.Finished 75 || task.State == TaskState.Aborted 76 || task.State == TaskState.Failed).All(x => x) 77 select job).ToList()); 64 78 #endregion 65 79 … … 69 83 WHERE JobState = {0} 70 84 "; 85 private const string GetStatisticsPendingJobs = @" 86 SELECT DISTINCT j.* 87 FROM [Job] j 88 WHERE j.JobState = 'StatisticsPending' 89 AND 'Calculating' NOT IN ( 90 SELECT t.TaskState 91 FROM [Task] t 92 WHERE t.JobId = j.JobId) 93 "; 71 94 #endregion 72 95 }
Note: See TracChangeset
for help on using the changeset viewer.