Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/02/11 15:23:59 (13 years ago)
Author:
cneumuel
Message:

#1233

  • changed the way lifecycle methods are called. The new service method TriggerLifecycle checks when the latest cleanup was made and performs one (if necessary). This can also be called by an external program (like a windows task)
  • robustified logging
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs

    r5535 r5593  
    229229    // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)]
    230230    public List<MessageContainer> Heartbeat(Heartbeat heartbeat) {
     231      TriggerLifecycle();
     232
    231233      using (trans.OpenTransaction()) {
    232234        return heartbeatManager.ProcessHeartbeat(heartbeat);
     
    255257    // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)]
    256258    public IEnumerable<Plugin> GetPlugins() {
    257       return dao.GetPlugins(x => true);
     259      return dao.GetPlugins(x => x.IsLocal == false);
    258260    }
    259261
     
    382384      }
    383385    }
     386
     387    public void TriggerLifecycle() {
     388      using (trans.OpenTransaction()) {
     389        DateTime lastCleanup = dao.GetLastCleanup();
     390        if (DateTime.Now - lastCleanup > TimeSpan.FromSeconds(59)) {
     391          dao.SetLastCleanup(DateTime.Now);
     392          lifecycleManager.Cleanup();
     393        }
     394      }
     395    }
    384396    #endregion
    385397
Note: See TracChangeset for help on using the changeset viewer.