Push dev work to master #2
7
index.js
7
index.js
|
@ -121,11 +121,10 @@ function rDelay (req, res, next) {
|
|||
|
||||
function rFrame (req, res, next) {
|
||||
log.info('/frame', { method : req.method })
|
||||
intval.frame(true, 0, () => {
|
||||
log.info('frame stopped')
|
||||
})
|
||||
res.send({})
|
||||
intval.frame(true, 0, (dir, len) => {
|
||||
res.send({ dir : true, len : len})
|
||||
return next()
|
||||
})
|
||||
}
|
||||
|
||||
function rStatus (req, res, next) {
|
||||
|
|
|
@ -297,7 +297,6 @@ intval.frame = function (dir = null, time = null, cb = () => {}) {
|
|||
}
|
||||
if (time !== 0) {
|
||||
intval._state.frame.paused = true
|
||||
|
||||
if (dir) {
|
||||
setTimeout(intval._pause, intval._frame.open)
|
||||
//log.info('frame', { pausing : time + intval._frame.open })
|
||||
|
@ -314,7 +313,9 @@ intval.frame = function (dir = null, time = null, cb = () => {}) {
|
|||
}, time + intval._frame.closed)
|
||||
}
|
||||
}
|
||||
intval._state.frame.cb = cb
|
||||
intval._state.frame.cb = (len) => {
|
||||
cb(dir, len)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Start a sequence of frames, using defaults or explicit instructions
|
||||
|
|
Loading…
Reference in New Issue