- Timestamp:
- 01/15/09 14:53:13 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r1127 r1133 58 58 lifecycleManager = ServiceLocator.GetLifecycleManager(); 59 59 60 lifecycleManager. OnServerHeartbeat +=61 new EventHandler(lifecycleManager_OnServerHeartbeat) ;60 lifecycleManager.RegisterHeartbeat( 61 new EventHandler(lifecycleManager_OnServerHeartbeat)); 62 62 63 63 lastHeartbeats = new Dictionary<Guid, DateTime>(); … … 90 90 foreach (Job job in allJobs) { 91 91 if (job.Client.ClientId == client.ClientId) { 92 // TODO check for job results 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 93 103 job.Client = null; 94 104 job.Percentage = 0; … … 231 241 long jobId, 232 242 byte[] result, 243 double percentage, 233 244 Exception exception, 234 245 bool finished) { … … 239 250 Job job = 240 251 jobAdapter.GetById(jobId); 252 253 if (job.Client == null) { 254 response.Success = false; 255 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_IS_NOT_BEEING_CALCULATED; 256 return response; 257 } 258 if (job.Client.ClientId != clientId) { 259 response.Success = false; 260 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_WRONG_CLIENT_FOR_JOB; 261 return response; 262 } 241 263 if (job == null) { 242 264 response.Success = false; 243 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_NO_JO _WITH_THIS_ID;265 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_NO_JOB_WITH_THIS_ID; 244 266 return response; 245 267 } … … 249 271 return response; 250 272 } 273 job.SerializedJob = result; 274 job.Percentage = percentage; 275 251 276 if (finished) { 252 277 job.State = State.finished; … … 263 288 jobResult.Job = job; 264 289 jobResult.Result = result; 290 jobResult.Percentage = percentage; 265 291 jobResult.Exception = exception; 266 292 267 jobResultAdapter.Update(jobResult); 293 jobResultAdapter.Update(jobResult); 294 jobAdapter.Update(job); 268 295 269 296 response.Success = true;
Note: See TracChangeset
for help on using the changeset viewer.