Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3472 for trunk/sources


Ignore:
Timestamp:
04/21/10 18:58:07 (15 years ago)
Author:
gkronber
Message:

Implemented quick fix for #987 (HiveEngine doesn't raise the JobFailed event if an exception occurs in the underlying engine)

File:
1 edited

Legend:

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

    r2111 r3472  
    2828using System.Xml;
    2929using HeuristicLab.Data;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Hive.Engine {
     
    4849    private void RegisterEvents() {
    4950      engine.Finished += new EventHandler(engine_Finished);
     51      engine.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred);
    5052    }
    5153
    5254    private void DeregisterEvents() {
    5355      engine.Finished -= new EventHandler(engine_Finished);
     56      engine.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred);
    5457    }
    5558
     
    5760      if (Engine.Canceled) this.progress = 0.0;
    5861      else this.progress = 1.0;
    59       if (JobStopped != null)
    60         JobStopped(this, new EventArgs());
     62      var listeners = JobStopped;
     63      if (listeners != null)
     64        listeners(this, e);
    6165    }
     66
     67    void engine_ExceptionOccurred(object sender, EventArgs<Exception> e) {
     68      this.progress = 0.0;
     69      var listeners = JobFailed;
     70      if (listeners != null)
     71        listeners(this, e);
     72    }
     73
    6274
    6375    #region IJob Members
Note: See TracChangeset for help on using the changeset viewer.