Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12296


Ignore:
Timestamp:
04/08/15 16:50:41 (10 years ago)
Author:
ascheibe
Message:

#2357 merged r12172 into stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Services.Hive

  • stable/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs

    r12009 r12296  
    122122    /// </summary>
    123123    private void DeleteObsoleteSlaves() {
    124       var slaves = dao.GetSlaves(x => x.IsDisposable.GetValueOrDefault() && x.SlaveState == SlaveState.Offline && (DateTime.Now - x.LastHeartbeat) > HeuristicLab.Services.Hive.Properties.Settings.Default.SweepInterval);
    125       foreach (DT.Slave slave in slaves) dao.DeleteSlave(slave.Id);
     124      var slaves = dao.GetSlaves(x => x.IsDisposable.GetValueOrDefault() &&
     125                                      x.SlaveState == SlaveState.Offline &&
     126                                      (DateTime.Now - x.LastHeartbeat) > Hive.Properties.Settings.Default.SweepInterval)
     127                                .Select(x => x.Id)
     128                                .ToArray();
     129
     130      foreach (Guid slaveId in slaves) {
     131        var downtimesAvailable = dao.GetDowntimes(x => x.ResourceId == slaveId).Any();
     132        if (!downtimesAvailable) {
     133          dao.DeleteSlave(slaveId);
     134        }
     135      }
    126136    }
    127137  }
Note: See TracChangeset for help on using the changeset viewer.