Changeset 12441 for branches/HiveStatistics/sources/HeuristicLab.Services.Hive.JanitorService/3.3/JanitorService.cs
- Timestamp:
- 06/12/15 17:04:39 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.JanitorService/3.3/JanitorService.cs
r12012 r12441 26 26 public partial class JanitorService : ServiceBase { 27 27 private HiveJanitor janitor; 28 private Thread janitorThread; 28 private Thread janitorCleanupThread; 29 private Thread janitorGenerateStatisticsThread; 29 30 30 31 public JanitorService() { … … 35 36 janitor = new HiveJanitor(); 36 37 37 janitorThread = new Thread(janitor.Run); 38 janitorThread.IsBackground = true; //dont keep app alive 39 janitorThread.Start(); 38 janitorCleanupThread = new Thread(janitor.RunCleanup) { 39 IsBackground = true 40 }; 41 janitorGenerateStatisticsThread = new Thread(janitor.RunGenerateStatistics) { 42 IsBackground = true 43 }; 44 45 janitorCleanupThread.Start(); 46 janitorGenerateStatisticsThread.Start(); 40 47 } 41 48 42 49 protected override void OnStop() { 43 50 janitor.StopJanitor(); 44 janitorThread.Join(); 51 janitorCleanupThread.Join(); 52 janitorGenerateStatisticsThread.Join(); 45 53 } 46 54 }
Note: See TracChangeset
for help on using the changeset viewer.