- Timestamp:
- 05/07/09 14:23:48 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs
r1596 r1752 29 29 30 30 public static int HEARTBEAT_MAX_DIF = 120; // value in seconds 31 public static int JOB_TIME_TO_LIVE = 5; 31 32 32 33 public static string RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS = "Logged in"; -
trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs
r1716 r1752 45 45 private static Dictionary<Guid, DateTime> lastHeartbeats = 46 46 new Dictionary<Guid,DateTime>(); 47 private static Dictionary<Guid, int> newAssignedJobs = 48 new Dictionary<Guid, int>(); 47 49 48 50 private static ReaderWriterLockSlim heartbeatLock = … … 110 112 foreach (Job job in jobAdapter.GetActiveJobsOf(client)) { 111 113 jobManager.ResetJobsDependingOnResults(job); 114 lock (newAssignedJobs) { 115 if (newAssignedJobs.ContainsKey(job.Id)) 116 newAssignedJobs.Remove(job.Id); 117 } 112 118 } 113 119 … … 317 323 } 318 324 if (!found) { 319 currJob.State = State.offline; 320 jobAdapter.Update(currJob); 325 lock (newAssignedJobs) { 326 if (newAssignedJobs.ContainsKey(currJob.Id)) { 327 newAssignedJobs[currJob.Id]--; 328 329 if (newAssignedJobs[currJob.Id] <= 0) { 330 currJob.State = State.offline; 331 jobAdapter.Update(currJob); 332 newAssignedJobs.Remove(currJob.Id); 333 } 334 } else { 335 currJob.State = State.offline; 336 jobAdapter.Update(currJob); 337 } 338 } // lock 339 } else { 340 lock (newAssignedJobs) { 341 if (newAssignedJobs.ContainsKey(currJob.Id)) 342 newAssignedJobs.Remove(currJob.Id); 343 } 321 344 } 322 345 } … … 338 361 response.Success = true; 339 362 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_PULLED; 363 lock (newAssignedJobs) { 364 newAssignedJobs.Add(job2Calculate.Id, ApplicationConstants.JOB_TIME_TO_LIVE); 365 } 340 366 } else { 341 367 response.Success = false;
Note: See TracChangeset
for help on using the changeset viewer.