Changeset 1811


Ignore:
Timestamp:
05/14/09 16:55:44 (12 years ago)
Author:
msteinbi
Message:

small refactorings in snapshot and abort functionality (#466)

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs

    r1770 r1811  
    7979    public static string RESPONSE_COMMUNICATOR_SEND_JOBRESULT = "Please send the Jobresult to the server";
    8080    public static string RESPONSE_COMMUNICATOR_PLUGINS_SENT = "Communicator.PluginsSent";
     81    public static strign RESPONSE_COMMUNICATOR_JOB_WAS_ABORTED = "Job was aborted";
    8182
    8283    public static string RESPONSE_JOB_ALL_JOBS = "Job.AllJobs";
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs

    r1772 r1811  
    305305            // save job progress
    306306            curJob.Percentage = jobProgress.Value;
    307             jobAdapter.Update(curJob);
    308307
    309308            if (curJob.State == State.requestSnapshot) {
     
    312311              curJob.State = State.requestSnapshotSent;
    313312            }
     313            jobAdapter.Update(curJob);
    314314          }
    315315        }
     
    397397        Job job =
    398398          jobAdapter.GetById(jobId);
    399 
     399       
    400400        if (job == null) {
    401401          response.Success = false;
     
    403403          response.JobId = jobId;
    404404          return response;
     405        }
     406        if (job.State == State.abort) {
     407          response.Success = false;
     408          response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_WAS_ABORTED;
    405409        }
    406410        if (job.Client == null) {
     
    440444          client.State = State.idle;
    441445          clientAdapter.Update(client);
    442 
    443           List<JobResult> jobResults = new List<JobResult>(jobResultAdapter.GetResultsOf(job));
    444           foreach (JobResult currentResult in jobResults)
    445             jobResultAdapter.Delete(currentResult);
    446         }
     446        }
     447        List<JobResult> jobResults = new List<JobResult>(jobResultAdapter.GetResultsOf(job));
     448        foreach (JobResult currentResult in jobResults)
     449          jobResultAdapter.Delete(currentResult);
    447450
    448451        JobResult jobResult =
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs

    r1799 r1811  
    308308          return response; // no commit needed
    309309        }
    310         if (job.State != State.calculating) {
     310        if (job.State != State.calculating && job.State != State.requestSnapshot && job.State != State.requestSnapshotSent) {
    311311          response.Success = false;
    312312          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED;
Note: See TracChangeset for help on using the changeset viewer.