- Timestamp:
- 01/15/09 14:53:13 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
r1121 r1133 33 33 34 34 IJobAdapter jobAdapter; 35 ILifecycleManager lifecycleManager; 35 36 36 37 #region IJobManager Members … … 38 39 public JobManager() { 39 40 jobAdapter = ServiceLocator.GetJobAdapter(); 41 42 lifecycleManager = ServiceLocator.GetLifecycleManager(); 43 44 lifecycleManager.RegisterStartup(new EventHandler(lifecycleManager_OnStartup)); 45 lifecycleManager.RegisterStartup(new EventHandler(lifecycleManager_OnShutdown)); 46 } 47 48 void checkForDeadJobs() { 49 List<Job> allJobs = new List<Job>(jobAdapter.GetAll()); 50 foreach (Job curJob in allJobs) { 51 if (curJob.State == State.calculating) { 52 // TODO check for job results 53 curJob.State = State.idle; 54 curJob.Percentage = 0; 55 curJob.Client = null; 56 } 57 } 58 } 59 60 void lifecycleManager_OnStartup(object sender, EventArgs e) { 61 checkForDeadJobs(); 62 } 63 64 void lifecycleManager_OnShutdown(object sender, EventArgs e) { 65 checkForDeadJobs(); 40 66 } 41 67
Note: See TracChangeset
for help on using the changeset viewer.