Changeset 8957 for trunk/sources/HeuristicLab.Services.Hive/3.3/Manager
- Timestamp:
- 11/28/12 09:57:35 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/SlaveShutdown (added) merged: 8944-8945,8949,8951,8953-8954
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs
r7723 r8957 47 47 if (heartbeat.HbInterval != slave.HbInterval) { 48 48 actions.Add(new MessageContainer(MessageContainer.MessageType.NewHBInterval)); 49 } 50 if (ShutdownSlaveComputer(slave.Id)) { 51 actions.Add(new MessageContainer(MessageContainer.MessageType.ShutdownComputer)); 49 52 } 50 53 … … 147 150 private bool SlaveIsAllowedToCalculate(Guid slaveId) { 148 151 // the slave may only calculate if there is no downtime right now. this needs to be checked for every parent resource also 149 return dao.GetParentResources(slaveId).All(r => dao.GetDowntimes(x => x.ResourceId == r.Id && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() == 0); 152 return dao.GetParentResources(slaveId).All(r => dao.GetDowntimes(x => x.ResourceId == r.Id && x.DowntimeType == DA.DowntimeType.Offline && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() == 0); 153 } 154 155 private bool ShutdownSlaveComputer(Guid slaveId) { 156 return dao.GetParentResources(slaveId).Any(r => dao.GetDowntimes(x => x.ResourceId == r.Id && x.DowntimeType == DA.DowntimeType.Shutdown && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() != 0); 150 157 } 151 158 }
Note: See TracChangeset
for help on using the changeset viewer.