From fc99b9ff06ea150721c2f4dd0286c569060e506c Mon Sep 17 00:00:00 2001 From: mmcw-dev Date: Wed, 20 Dec 2017 20:51:14 -0500 Subject: [PATCH] Do not wait for sequence to finish to respond to /sequence request --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index fa20f90..c580d94 100644 --- a/index.js +++ b/index.js @@ -293,6 +293,7 @@ function rSequence (req, res, next) { return next() }) } else { + console.time('sequence time') return sequence.start({ loop : [ (next) => { intval.frame(dir, exposure, (len) => { @@ -304,9 +305,10 @@ function rSequence (req, res, next) { }, delay) }] }, (seq) => { - res.send(seq) - return next() + console.timeEnd('sequence time') }) + res.send({}) + return next() } }