Ignore:
Timestamp:
01/14/09 17:09:40 (12 years ago)
Author:
msteinbi
Message:

Refactoring of client communicator (#466)

File:
1 edited

Legend:

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

    r1124 r1127  
    203203          Job job2Calculate = allOfflineJobs.First.Value;
    204204          job2Calculate.State = State.calculating;
     205          job2Calculate.Client = clientAdapter.GetById(clientId);
    205206          response.Job = job2Calculate;
    206207          jobAdapter.Update(job2Calculate);
     
    292293        return response;
    293294      }
     295      List<Job> allJobs = new List<Job>(jobAdapter.GetAll());
     296      if (client.State == State.calculating) {
     297        // check wich job the client was calculating and reset it
     298        foreach (Job job in allJobs) {
     299          if (job.Client.ClientId == client.ClientId) {
     300            // TODO check for job results
     301            job.Client = null;
     302            job.Percentage = 0;
     303            job.State = State.idle;
     304          }
     305        }
     306      }
     307
    294308      client.State = State.offline;
    295309      clientAdapter.Update(client);
Note: See TracChangeset for help on using the changeset viewer.