Changeset 4305 for branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/SlaveCommunicator.cs
- Timestamp:
- 08/24/10 18:37:04 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/SlaveCommunicator.cs
r4289 r4305 176 176 /// <param name="slaveInfo"></param> 177 177 /// <returns></returns> 178 public Response Login( Guid slaveId) {178 public Response Login(SlaveDto slave) { 179 179 Response response = new Response(); 180 180 181 181 heartbeatLock.EnterWriteLock(); 182 if (lastHeartbeats.ContainsKey(slave Id)) {183 lastHeartbeats[slave Id] = DateTime.Now;182 if (lastHeartbeats.ContainsKey(slave.Id)) { 183 lastHeartbeats[slave.Id] = DateTime.Now; 184 184 } else { 185 lastHeartbeats.Add(slave Id, DateTime.Now);185 lastHeartbeats.Add(slave.Id, DateTime.Now); 186 186 } 187 187 heartbeatLock.ExitWriteLock(); 188 188 189 SlaveDto dbSlave = DaoLocator.SlaveDao.FindById(slaveId); 190 191 //Really set offline? 192 //Reconnect issues with the currently calculating jobs 193 dbSlave.State = SlaveState.Idle; 194 dbSlave.CalendarSyncStatus = dbSlave != null ? dbSlave.CalendarSyncStatus : CalendarState.NotAllowedToFetch; 189 SlaveDto dbSlave = DaoLocator.SlaveDao.FindById(slave.Id); 190 191 slave.CalendarSyncStatus = dbSlave != null ? dbSlave.CalendarSyncStatus : CalendarState.NotAllowedToFetch; 192 slave.State = SlaveState.Idle; 195 193 196 194 if (dbSlave == null) 197 DaoLocator.SlaveDao.Insert(dbSlave); 198 else 199 DaoLocator.SlaveDao.Update(dbSlave); 195 DaoLocator.SlaveDao.Insert(slave); 196 else { 197 DaoLocator.SlaveDao.Update(slave); 198 } 200 199 201 200 return response;
Note: See TracChangeset
for help on using the changeset viewer.