Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9193 for branches/UnloadJobs


Ignore:
Timestamp:
01/28/13 15:27:11 (12 years ago)
Author:
ascheibe
Message:

#2005 simplified refreshing of jobs in the Hive client as this isn't needed anymore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r9173 r9193  
    109109        IsAllowedPrivileged = HiveServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());
    110110
    111         var oldJobs = jobs ?? new ItemCollection<RefreshableJob>();
    112111        jobs = new HiveItemCollection<RefreshableJob>();
    113112        var jobsLoaded = HiveServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs());
    114113
    115114        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 });
    135116        }
    136117      }
     
    143124      }
    144125    }
     126
    145127    public void RefreshAsync(Action<Exception> exceptionCallback) {
    146128      var call = new Func<Exception>(delegate() {
Note: See TracChangeset for help on using the changeset viewer.