Post sequence callbacks are not firing. Skip for now and just call back immediately

This commit is contained in:
mmcw-dev 2017-12-20 22:39:20 -05:00
parent 02aea27ff9
commit 8333f451f8
2 changed files with 8 additions and 14 deletions

View File

@ -304,11 +304,10 @@ function rSequence (req, res, next) {
}
}
if (intval._state.sequence && sequence._state.active) {
return sequence.setStop(() => {
intval._state.sequence = false
res.send({ stopped : true })
return next()
})
sequence.setStop()
intval._state.sequence = false
res.send({ stopped : true })
return next()
} else {
console.time('sequence time')
intval._state.sequence = true
@ -488,10 +487,9 @@ function seq () {
if (intval._state.sequence && sequence._state.active) {
log.info('sequence', { method : 'release' , stop: true })
return sequence.setStop(() => {
intval._state.sequence = false
return cb()
})
sequence.setStop()
intval._state.sequence = false
return cb()
} else {
console.time('sequence time')
log.info('sequence', { method : 'release', start : true })

View File

@ -43,9 +43,8 @@ sequence.start = function (options, cb) {
sequence.step()
}
sequence.setStop = function (cb) {
sequence.setStop = function () {
sequence._state.active = false
sequence._state.input = cb
}
sequence.stop = function () {
@ -58,10 +57,8 @@ sequence.stop = function () {
sequence._loop.arr = []
if (sequence._state.stop) sequence._state.stop()
if (sequence._state.input) sequence._state.input()
sequence._state.stop = null
sequence._state.input = null
}
sequence.pause = function () {
@ -74,7 +71,6 @@ sequence.resume = function () {
}
sequence.step = function () {
log.info('step', `Started step ${sequence._state.count}`)
if (sequence._state.active && !sequence._state.paused) {
if (sequence._state.arr.length > 0) {
if (sequence._state.count > sequence._state.arr.length - 1) {