Skip to content

Commit

Permalink
Merge pull request #22 from rik-bos/blockingExecution
Browse files Browse the repository at this point in the history
Blocking execution
  • Loading branch information
diego-antonelli authored Sep 29, 2020
2 parents bab384f + a0e0ca2 commit b95956e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/MicroflowTimer/widget/MicroflowTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ define([
_timeout: null,
_timerStarted: false,

_flowRunning: false,

postCreate: function() {
this._handles = [];

Expand Down Expand Up @@ -168,6 +170,12 @@ define([
},

_executeEvent: function() {
if (this._flowRunning === true) {
return;
}

this._flowRunning = true;

if(this.callEvent === "callMicroflow" && this.microflow) {
this._execMf()
} else if (this.callEvent === "callNanoflow" && this.nanoflow.nanoflow){
Expand Down Expand Up @@ -195,9 +203,11 @@ define([
logger.debug(this.id + "._execMf callback, stopping timer");
this._stopTimer();
}
this._flowRunning = false;
}),
error: lang.hitch(this, function(error) {
logger.error(this.id + ": An error ocurred while executing microflow: ", error);
this._flowRunning = false;
})
};

Expand All @@ -224,9 +234,11 @@ define([
logger.debug(this.id + "._executeNanoFlow callback, stopping timer");
this._stopTimer();
}
this._flowRunning = false;
}),
error: lang.hitch(this, function(error) {
logger.error(this.id + ": An error ocurred while executing nanoflow: ", error);
this._flowRunning = false;
})
});
}
Expand Down
Binary file modified test/widgets/MicroflowTimer.mpk
Binary file not shown.

0 comments on commit b95956e

Please sign in to comment.