- Timestamp:
- 01/22/09 15:21:02 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
r1160 r1170 49 49 } 50 50 51 p ublic void ResetJobsDependingOnResults(Job job) {51 private JobResult GetLastJobResult(Job job) { 52 52 List<JobResult> allJobResults = new List<JobResult>(jobResultAdapter.GetResultsOf(job)); 53 53 JobResult lastJobResult = null; 54 54 foreach (JobResult jR in allJobResults) { 55 55 // if lastJobResult was before the current jobResult the lastJobResult must be updated 56 if (lastJobResult == null || 56 if (lastJobResult == null || 57 57 (jR.timestamp > lastJobResult.timestamp)) 58 58 lastJobResult = jR; 59 59 } 60 return lastJobResult; 61 } 62 63 public void ResetJobsDependingOnResults(Job job) { 64 JobResult lastJobResult = GetLastJobResult(job); 60 65 if (lastJobResult != null) { 61 66 job.Percentage = lastJobResult.Percentage; … … 127 132 } 128 133 134 job.DateCreated = DateTime.Now; 129 135 jobAdapter.Update(job); 130 136 response.Success = true; … … 160 166 } 161 167 168 public ResponseObject<JobResult> GetLasJobResultOf(long jobId) { 169 ResponseObject<JobResult> response = new ResponseObject<JobResult>(); 170 response.Success = true; 171 response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_RESULT_SENT; 172 response.Obj = GetLastJobResult(jobAdapter.GetById(jobId)); 173 174 return response; 175 } 176 162 177 #endregion 163 178 }
Note: See TracChangeset
for help on using the changeset viewer.