@riteable/q-worker
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -49,3 +49,3 @@ const EventEmitter = require('events') | ||
} finally { | ||
_removeProcessingTask(i) | ||
setTimeout(() => _removeProcessingTask(i)) | ||
} | ||
@@ -52,0 +52,0 @@ } |
{ | ||
"name": "@riteable/q-worker", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Rate limit and queue async functions.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -41,11 +41,11 @@ const test = require('ava') | ||
queue.add(task) | ||
const task1 = queue.add(task) | ||
const task2 = queue.add(task) | ||
const task3 = queue.add(task) | ||
const result = await new Promise((resolve) => { | ||
queue.events.on('done', () => resolve(true)) | ||
setTimeout(() => resolve(false), timeout * 2) | ||
queue.events.on('done', () => resolve(Promise.all([task1, task2, task3]))) | ||
}) | ||
t.true(result) | ||
t.deepEqual(result, [1, 2, 3]) | ||
}) |
5675
126