diff options
Diffstat (limited to 'lib/api.js')
-rw-r--r-- | lib/api.js | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -30,8 +30,13 @@ async function queue_processor() { await new Promise(resolve => bus.once('send', resolve)); busy = true; } + const before = new Date(); await send_this(queue.dequeue().element); - await sleep(400); // 333 should work, but 400 should still allow some manual requests to go through during development + const duration = new Date() - before; + console.log(before.toISOString(), new Date().toISOString(), duration); + if (duration < 400) { // 333 should work, but 400 should still allow some manual requests to go through during development + await sleep(400 - duration); + } } catch (e) { running = false; throw e; |