Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/17/15 15:14:04 (7 years ago)
Author:
ascheibe
Message:

#2388 some more cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs

    r12861 r12866  
    3434    public void Cleanup() {
    3535      var pm = PersistenceManager;
    36       // same transactions as the old EventManager
    3736      pm.UseTransaction(() => {
    3837        SetTimeoutSlavesOffline(pm);
     
    5756        if (!slave.LastHeartbeat.HasValue ||
    5857            (DateTime.Now - slave.LastHeartbeat.Value) >
    59             HeuristicLab.Services.Hive.Properties.Settings.Default.SlaveHeartbeatTimeout) {
     58            Properties.Settings.Default.SlaveHeartbeatTimeout) {
    6059          slave.SlaveState = SlaveState.Offline;
    6160        }
     
    8887    private void SetTimeoutTasksWaiting(IPersistenceManager pm) {
    8988      var taskDao = pm.TaskDao;
    90       var tasks = taskDao.GetAll().Where(x => (x.State == TaskState.Calculating && (DateTime.Now - x.LastHeartbeat) > HeuristicLab.Services.Hive.Properties.Settings.Default.CalculatingJobHeartbeatTimeout)
    91                                            || (x.State == TaskState.Transferring && (DateTime.Now - x.LastHeartbeat) > HeuristicLab.Services.Hive.Properties.Settings.Default.TransferringJobHeartbeatTimeout));
     89      var tasks = taskDao.GetAll().Where(x => (x.State == TaskState.Calculating && (DateTime.Now - x.LastHeartbeat) > Properties.Settings.Default.CalculatingJobHeartbeatTimeout)
     90                                           || (x.State == TaskState.Transferring && (DateTime.Now - x.LastHeartbeat) > Properties.Settings.Default.TransferringJobHeartbeatTimeout));
    9291      foreach (var task in tasks) {
    9392        task.State = TaskState.Waiting;
     
    112111        .Where(x => x.IsDisposable.GetValueOrDefault()
    113112                 && x.SlaveState == SlaveState.Offline
    114                  && (DateTime.Now - x.LastHeartbeat) > Hive.Properties.Settings.Default.SweepInterval)
     113                 && (DateTime.Now - x.LastHeartbeat) > Properties.Settings.Default.SweepInterval)
    115114        .Select(x => x.ResourceId)
    116115        .ToList();
Note: See TracChangeset for help on using the changeset viewer.