From 1cc38896329328636134b19af0af20c887cdcdba Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 1 Dec 2020 21:59:04 +0300 Subject: [PATCH] minor tweak... Signed-off-by: Alex A. Naanou --- package.json | 2 +- runner.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4474aa3..782280a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-types", - "version": "5.0.24", + "version": "5.0.25", "description": "Generic JavaScript types and type extensions...", "main": "main.js", "scripts": { diff --git a/runner.js b/runner.js index 1fb1c6e..9e6a0b2 100644 --- a/runner.js +++ b/runner.js @@ -200,7 +200,15 @@ object.Constructor('Queue', Array, { && this.state == 'running'){ this.auto_stop ? // auto-stop... - this.stop() + (this.poling_delay ? + // wait a bit then stop if still empty... + setTimeout(function(){ + that.length > 0 ? + that.__run_tasks__() + : that.stop() + }, this.poling_delay || 200) + // stop now... + : this.stop()) // pole... : (this.poling_delay && setTimeout(