Changeset 7434 for trunk/sources/HeuristicLab.Services.Hive/3.3/Manager
- Timestamp:
- 01/31/12 22:22:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs
r7259 r7434 45 45 } 46 46 47 public void Cleanup() { 47 public void Cleanup() { 48 48 trans.UseTransaction(() => { 49 49 SetTimeoutSlavesOffline(); … … 89 89 if (!slave.LastHeartbeat.HasValue || (DateTime.Now - slave.LastHeartbeat.Value) > HeuristicLab.Services.Hive.Properties.Settings.Default.SlaveHeartbeatTimeout) { 90 90 slave.SlaveState = DT.SlaveState.Offline; 91 SetTasksWaiting(slave.Id);92 91 dao.UpdateSlave(slave); 93 92 } … … 102 101 foreach (var task in parentTasksToFinish) { 103 102 dao.UpdateTaskState(task.Id, TaskState.Finished, null, null, string.Empty); 104 }105 }106 107 private void SetTasksWaiting(Guid slaveId) {108 var tasks = dao.GetTasks(x => x.State == TaskState.Calculating).Where(x => x.StateLog.Last().SlaveId == slaveId);109 foreach (var j in tasks) {110 DT.Task task = dao.UpdateTaskState(j.Id, TaskState.Waiting, slaveId, null, "Slave timed out.");111 task.Command = null;112 dao.UpdateTask(task);113 103 } 114 104 }
Note: See TracChangeset
for help on using the changeset viewer.