Changeset 1928


Ignore:
Timestamp:
05/28/09 15:48:54 (12 years ago)
Author:
msteinbi
Message:

corrected job reset when client logs out (#466)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs

    r1831 r1928  
    285285    /// <param name="response"></param>
    286286    private void processJobProcess(HeartBeatData hbData, IJobAdapter jobAdapter, IClientAdapter clientAdapter, ResponseHB response) {
    287       if (hbData.JobProgress != null) {
     287      if (hbData.JobProgress != null && hbData.JobProgress.Count > 0) {
    288288        List<Job> jobsOfClient = new List<Job>(jobAdapter.GetActiveJobsOf(clientAdapter.GetById(hbData.ClientId)));
    289289        if (jobsOfClient == null || jobsOfClient.Count == 0) {
     
    537537          return response;
    538538        }
    539         List<Job> allJobs = new List<Job>(jobAdapter.GetAll());
    540539        if (client.State == State.calculating) {
    541540          // check wich job the client was calculating and reset it
    542           foreach (Job job in allJobs) {
    543             if (job.Client != null) {
    544               if (job.Client.Id == client.Id) {
    545                 jobManager.ResetJobsDependingOnResults(job);
    546               }
    547             }
     541          ICollection<Job> jobsOfClient = jobAdapter.GetJobsOf(client);
     542          foreach (Job job in jobsOfClient) {
     543            if (job.State != State.finished)
     544              jobManager.ResetJobsDependingOnResults(job);
    548545          }
    549546        }
Note: See TracChangeset for help on using the changeset viewer.