- Timestamp:
- 01/21/09 16:22:25 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
r1149 r1160 50 50 51 51 public void ResetJobsDependingOnResults(Job job) { 52 List<JobResult> allJobResults = new List<JobResult>(jobResultAdapter.Get All());52 List<JobResult> allJobResults = new List<JobResult>(jobResultAdapter.GetResultsOf(job)); 53 53 JobResult lastJobResult = null; 54 54 foreach (JobResult jR in allJobResults) { 55 if (jR.Job != null && jR.Job.Id == job.Id) { 56 if (lastJobResult != null) { 57 // if lastJobResult was before the current jobResult the lastJobResult must be updated 58 if ((jR.timestamp.Subtract(lastJobResult.timestamp)).Seconds > 0) 59 lastJobResult = jR; 60 } 61 } 55 // if lastJobResult was before the current jobResult the lastJobResult must be updated 56 if (lastJobResult == null || 57 (jR.timestamp > lastJobResult.timestamp)) 58 lastJobResult = jR; 62 59 } 63 60 if (lastJobResult != null) { 64 job.Client = null;65 61 job.Percentage = lastJobResult.Percentage; 66 job.State = State.offline;67 62 job.SerializedJob = lastJobResult.Result; 68 63 } else { 69 job.Client = null;70 64 job.Percentage = 0; 71 job.State = State.offline;72 65 } 66 67 job.Client = null; 68 job.State = State.offline; 69 73 70 jobAdapter.Update(job); 74 71 }
Note: See TracChangeset
for help on using the changeset viewer.