Changeset 9193 for branches/UnloadJobs/HeuristicLab.Clients.Hive
- Timestamp:
- 01/28/13 15:27:11 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r9173 r9193 109 109 IsAllowedPrivileged = HiveServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged()); 110 110 111 var oldJobs = jobs ?? new ItemCollection<RefreshableJob>();112 111 jobs = new HiveItemCollection<RefreshableJob>(); 113 112 var jobsLoaded = HiveServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs()); 114 113 115 114 foreach (var j in jobsLoaded) { 116 var job = oldJobs.SingleOrDefault(x => x.Id == j.Id); 117 if (job == null) { 118 // new 119 jobs.Add(new RefreshableJob(j) { IsAllowedPrivileged = this.isAllowedPrivileged }); 120 } else { 121 // update 122 job.Job = j; 123 job.IsAllowedPrivileged = this.isAllowedPrivileged; 124 jobs.Add(job); 125 } 126 } 127 // remove those which were not in the list of loaded hiveexperiments 128 foreach (var job in oldJobs) { 129 if (job.Id == Guid.Empty) { 130 // experiment not uploaded... keep 131 jobs.Add(job); 132 } else { 133 job.RefreshAutomatically = false; // stop results polling 134 } 115 jobs.Add(new RefreshableJob(j) { IsAllowedPrivileged = this.isAllowedPrivileged }); 135 116 } 136 117 } … … 143 124 } 144 125 } 126 145 127 public void RefreshAsync(Action<Exception> exceptionCallback) { 146 128 var call = new Func<Exception>(delegate() {
Note: See TracChangeset
for help on using the changeset viewer.