Changeset 8871 for trunk/sources
- Timestamp:
- 11/06/12 12:53:58 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveTasks/HiveTask.cs
r7259 r8871 334 334 private void RegisterJobEvents() { 335 335 if (task != null) 336 task.PropertyChanged += new PropertyChangedEventHandler( job_PropertyChanged);336 task.PropertyChanged += new PropertyChangedEventHandler(task_PropertyChanged); 337 337 } 338 338 339 339 private void DeregisterJobEvents() { 340 340 if (task != null) 341 task.PropertyChanged += new PropertyChangedEventHandler( job_PropertyChanged);342 } 343 344 private void job_PropertyChanged(object sender, PropertyChangedEventArgs e) {341 task.PropertyChanged += new PropertyChangedEventHandler(task_PropertyChanged); 342 } 343 344 private void task_PropertyChanged(object sender, PropertyChangedEventArgs e) { 345 345 if (e.PropertyName == "State") { 346 346 IsFinishedTaskDownloaded = false; -
trunk/sources/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs
r8869 r8871 34 34 private JobResultPoller jobResultPoller; 35 35 private ConcurrentTaskDownloader<ItemTask> jobDownloader; 36 private static object locker = new object(); 36 private object locker = new object(); 37 private object downloadFinishedLocker = new object(); 37 38 38 39 public bool IsProgressing { get; set; } … … 258 259 } 259 260 } 261 260 262 private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<LightweightTask>> e) { 261 263 foreach (LightweightTask lightweightTask in e.Value) { … … 273 275 hiveTask.IsDownloading = true; 274 276 jobDownloader.DownloadTaskData(hiveTask.Task, (localJob, itemJob) => { 275 log.LogMessage(string.Format("Finished downloading task {0}", localJob.Id)); 276 HiveTask localHiveTask = GetHiveTaskById(localJob.Id); 277 278 if (itemJob == null) { 279 localHiveTask.IsDownloading = false; 280 } 281 282 if (itemJob == null) { 283 // something bad happened to this task. bad task, BAAAD task! 284 } else { 285 // if the task is paused, download but don't integrate into parent optimizer (to avoid Prepare) 286 287 if (localJob.State == TaskState.Paused) { 288 localHiveTask.ItemTask = itemJob; 277 lock (downloadFinishedLocker) { 278 log.LogMessage(string.Format("Finished downloading task {0}", localJob.Id)); 279 HiveTask localHiveTask = GetHiveTaskById(localJob.Id); 280 281 if (itemJob == null) { 282 // something bad happened to this task. bad task, BAAAD task! 283 localHiveTask.IsDownloading = false; 289 284 } else { 290 if (localJob.ParentTaskId.HasValue) {291 HiveTask parentHiveTask = GetHiveTaskById(localJob.ParentTaskId.Value);292 parentHiveTask.IntegrateChild(itemJob, localJob.Id);285 // if the task is paused, download but don't integrate into parent optimizer (to avoid Prepare) 286 if (localJob.State == TaskState.Paused) { 287 localHiveTask.ItemTask = itemJob; 293 288 } else { 294 localHiveTask.ItemTask = itemJob; 289 if (localJob.ParentTaskId.HasValue) { 290 HiveTask parentHiveTask = GetHiveTaskById(localJob.ParentTaskId.Value); 291 parentHiveTask.IntegrateChild(itemJob, localJob.Id); 292 } else { 293 localHiveTask.ItemTask = itemJob; 294 } 295 295 } 296 localHiveTask.IsDownloading = false; 297 localHiveTask.Task.LastTaskDataUpdate = lightweightTask.LastTaskDataUpdate; 296 298 } 297 localHiveTask.IsDownloading = false;298 localHiveTask.Task.LastTaskDataUpdate = localJob.LastTaskDataUpdate;299 299 } 300 300 }); … … 334 334 || j.Task.State == TaskState.Aborted 335 335 || j.Task.State == TaskState.Failed) 336 && j.IsFinishedTaskDownloaded);336 && !j.IsDownloading); 337 337 } 338 338
Note: See TracChangeset
for help on using the changeset viewer.