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

#2388 some more cleanups

Location:
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3
Files:
3 edited

Legend:

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

    r12858 r12866  
    6565            var lifecycle = lifecycleDao.GetLastLifecycle();
    6666            if (lifecycle == null
    67                 || DateTime.Now - lifecycle.LastCleanup > HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval) {
     67                || DateTime.Now - lifecycle.LastCleanup > Properties.Settings.Default.CleanupInterval) {
    6868              lifecycleDao.UpdateLifecycle();
    6969              cleanup = true;
     
    8080          LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log(string.Format("HiveJanitor: The following exception occured: {0}", e.ToString()));
    8181        }
    82         cleanupWaitHandle.WaitOne(HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval);
     82        cleanupWaitHandle.WaitOne(Properties.Settings.Default.CleanupInterval);
    8383      }
    8484      cleanupWaitHandle.Close();
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs

    r12776 r12866  
    265265      var taskDao = pm.TaskDao;
    266266      var dimClientDao = pm.DimClientDao;
    267       var stateLogDao = pm.StateLogDao;
    268267
    269268      var factTaskIds = factTaskDao.GetAll().Select(x => x.TaskId);
  • 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.