Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1834


Ignore:
Timestamp:
05/15/09 15:16:26 (16 years ago)
Author:
gkronber
Message:

Added check to get either the result of a finished job or a snapshot. #545 (Engine which can be executed in the Hive)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs

    r1815 r1834  
    130130      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl);
    131131
    132       // request snapshot
    133       executionEngineFacade.RequestSnapshot(jobId);
    134 
    135132      // poll until snapshot is ready
    136133      ResponseObject<JobResult> response;
    137       do {
    138         response = executionEngineFacade.GetLastResult(jobId, true);
    139         if (response.Success && response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) {
    140           Thread.Sleep(1000);
    141         }
    142       } while (response.Success && response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE);
    143 
     134
     135      // request snapshot
     136      Response snapShotResponse = executionEngineFacade.RequestSnapshot(jobId);
     137      if (snapShotResponse.StatusMessage == ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED) {
     138        response = executionEngineFacade.GetLastResult(jobId, false);
     139      } else {
     140        do {
     141          response = executionEngineFacade.GetLastResult(jobId, true);
     142          if (response.Success && response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) {
     143            Thread.Sleep(1000);
     144          }
     145        } while (response.Success && response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE);
     146      }
    144147      if (response.Success) {
    145148        JobResult jobResult = response.Obj;
Note: See TracChangeset for help on using the changeset viewer.