- Timestamp:
- 12/05/11 16:45:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r7059 r7125 113 113 jobs = null; 114 114 throw; 115 } 116 finally { 115 } finally { 117 116 OnRefreshed(); 118 117 } … … 297 296 } 298 297 refreshableJob.Job.Modified = false; 299 } 300 finally { 298 } finally { 301 299 refreshableJob.IsProgressing = false; 302 300 } … … 362 360 } 363 361 } 364 }, -1, "Failed to upload plugins");362 }, Settings.Default.MaxRepeatServiceCalls, "Failed to upload plugins"); 365 363 cancellationToken.ThrowIfCancellationRequested(); 366 364 hiveTask.Task.PluginsNeededIds.Add(configPluginId); … … 377 375 } 378 376 } 379 }, 50, "Failed to add task", log);377 }, Settings.Default.MaxRepeatServiceCalls, "Failed to add task", log); 380 378 cancellationToken.ThrowIfCancellationRequested(); 381 379 … … 400 398 if (!ae.InnerExceptions.All(e => e is TaskCanceledException)) throw ae; // for some reason the WaitAll throws a AggregateException containg a TaskCanceledException. i don't know where it comes from, however the tasks all finish properly, so for now just ignore it 401 399 } 402 } 403 finally { 400 } finally { 404 401 if (!semaphoreReleased) taskUploadSemaphore.Release(); 405 402 } … … 423 420 totalJobCount = allTasks.Count(); 424 421 422 refreshableJob.Progress.Status = "Downloading tasks..."; 425 423 TaskDownloader downloader = new TaskDownloader(allTasks.Select(x => x.Id)); 426 424 downloader.StartAsync(); … … 445 443 } 446 444 445 refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks..."; 447 446 // build child-task tree 448 447 foreach (HiveTask hiveTask in refreshableJob.HiveTasks) { … … 451 450 452 451 refreshableJob.OnLoaded(); 453 } 454 finally { 452 } finally { 455 453 refreshableJob.IsProgressing = false; 456 454 } 457 455 } 458 456 459 private static void BuildHiveJobTree(HiveTask parentHive Job, IEnumerable<LightweightTask> allJobs, IDictionary<Guid, HiveTask> allHiveJobs) {460 IEnumerable<LightweightTask> childTasks = from job in all Jobs461 where job.ParentTaskId.HasValue && job.ParentTaskId.Value == parentHive Job.Task.Id457 private static void BuildHiveJobTree(HiveTask parentHiveTask, IEnumerable<LightweightTask> allTasks, IDictionary<Guid, HiveTask> allHiveTasks) { 458 IEnumerable<LightweightTask> childTasks = from job in allTasks 459 where job.ParentTaskId.HasValue && job.ParentTaskId.Value == parentHiveTask.Task.Id 462 460 orderby job.DateCreated ascending 463 461 select job; 464 462 foreach (LightweightTask task in childTasks) { 465 HiveTask childHiveTask = allHive Jobs[task.Id];466 parentHive Job.AddChildHiveJob(childHiveTask);467 BuildHiveJobTree(childHiveTask, all Jobs, allHiveJobs);463 HiveTask childHiveTask = allHiveTasks[task.Id]; 464 parentHiveTask.AddChildHiveTask(childHiveTask); 465 BuildHiveJobTree(childHiveTask, allTasks, allHiveTasks); 468 466 } 469 467 }
Note: See TracChangeset
for help on using the changeset viewer.