Changeset 1118
- Timestamp:
- 01/14/09 15:32:14 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs
r1096 r1118 6 6 namespace HeuristicLab.Hive.Contracts { 7 7 public class ApplicationConstants { 8 9 public static int HEARTBEAT_MAX_DIF = 30; // value in seconds 8 10 9 11 public static string RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS = "Logged in"; -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r1103 r1118 59 59 DateTime lastHbOfClient = lastHeartbeats[client.ClientId]; 60 60 TimeSpan dif = DateTime.Now.Subtract(lastHbOfClient); 61 Console.WriteLine(dif); 61 // check if time between last hearbeat and now is greather than HEARTBEAT_MAX_DIF 62 if (dif.Seconds > ApplicationConstants.HEARTBEAT_MAX_DIF) { 63 // if client calculated jobs, the job must be reset 64 if (client.State == State.calculating) { 65 // check wich job the client was calculating and reset it 66 foreach (Job job in allJobs) { 67 if (job.Client.ClientId == client.ClientId) { 68 // TODO check for job results 69 job.Client = null; 70 job.Percentage = 0; 71 job.State = State.idle; 72 } 73 } 74 } 75 76 // client must be set offline 77 client.State = State.offline; 78 clientAdapter.Update(client); 79 lastHeartbeats.Remove(client.ClientId); 80 } 62 81 } 63 82 } else {
Note: See TracChangeset
for help on using the changeset viewer.