Changeset 1135
- Timestamp:
- 01/15/09 15:06:15 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r1133 r1135 90 90 foreach (Job job in allJobs) { 91 91 if (job.Client.ClientId == client.ClientId) { 92 List<JobResult> allJobResults = new List<JobResult>(jobResultAdapter.GetAll()); 93 foreach (JobResult jR in allJobResults) { 94 JobResult lastJobResult = null; 95 if (jR.Job != null && jR.Job.Id == job.Id) { 96 if (lastJobResult != null) { 97 98 } 99 } 100 } 101 102 103 job.Client = null; 104 job.Percentage = 0; 105 job.State = State.idle; 92 resetJobsDependingOnResults(job); 106 93 } 107 94 } … … 121 108 } 122 109 110 private void resetJobsDependingOnResults(Job job) { 111 List<JobResult> allJobResults = new List<JobResult>(jobResultAdapter.GetAll()); 112 JobResult lastJobResult = null; 113 foreach (JobResult jR in allJobResults) { 114 if (jR.Job != null && jR.Job.Id == job.Id) { 115 if (lastJobResult != null) { 116 // if lastJobResult was before the current jobResult the lastJobResult must be updated 117 if ((jR.timestamp.Subtract(lastJobResult.timestamp)).Seconds > 0) 118 lastJobResult = jR; 119 } 120 } 121 } 122 if (lastJobResult != null) { 123 job.Client = null; 124 job.Percentage = lastJobResult.Percentage; 125 job.State = State.idle; 126 job.SerializedJob = lastJobResult.Result; 127 } else { 128 job.Client = null; 129 job.Percentage = 0; 130 job.State = State.idle; 131 } 132 } 133 123 134 #region IClientCommunicator Members 124 135 … … 325 336 foreach (Job job in allJobs) { 326 337 if (job.Client.ClientId == client.ClientId) { 327 // TODO check for job results 328 job.Client = null; 329 job.Percentage = 0; 330 job.State = State.idle; 338 resetJobsDependingOnResults(job); 331 339 } 332 340 }
Note: See TracChangeset
for help on using the changeset viewer.