- Timestamp:
- 01/22/09 15:21:02 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs
r1133 r1170 81 81 public static string RESPONSE_JOB_JOB_REMOVED = "Job.JobRemoved"; 82 82 public static string RESPONSE_JOB_JOBSTATE_MUST_BE_OFFLINE = "Job.JobStateMustBeOffline"; 83 public static string RESPONSE_JOB_JOB_RESULT_SENT = "Job.JobResultSent"; 83 84 } 84 85 } -
trunk/sources/HeuristicLab.Hive.Contracts/HiveServerMessages.resx
r1133 r1170 235 235 <value>This client is not registered to calculate this job</value> 236 236 </data> 237 <data name="Job.JobResultSent" xml:space="preserve"> 238 <value>Job Result sent successfully</value> 239 </data> 237 240 </root> -
trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IJobManager.cs
r967 r1170 39 39 [OperationContract] 40 40 Response RemoveJob(long jobId); 41 [OperationContract] 42 ResponseObject<JobResult> GetLasJobResultOf(long jobId); 41 43 } 42 44 } -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r1166 r1170 236 236 job2Calculate.Client.State = State.calculating; 237 237 238 job2Calculate.DateCalculated = DateTime.Now; 238 239 response.Job = job2Calculate; 239 240 jobAdapter.Update(job2Calculate); … … 317 318 jobResult.Percentage = percentage; 318 319 jobResult.Exception = exception; 320 jobResult.DateFinished = DateTime.Now; 319 321 320 322 jobResultAdapter.Update(jobResult); -
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.