From 2cb9a0706edc2e2b9d5b472b79424d8e6a53e225 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 25 Jul 2019 18:22:37 +0300 Subject: [PATCH] cleanup and minor fixes... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/core.js | 42 +++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/ui (gen4)/features/core.js b/ui (gen4)/features/core.js index a43bbc76..3b0fe18b 100755 --- a/ui (gen4)/features/core.js +++ b/ui (gen4)/features/core.js @@ -458,24 +458,32 @@ var LifeCycleActions = actions.Actions({ // ready timeout -> force ready... this.config['declare-ready-timeout'] > 0 - && setTimeout(function(){ - // cleanup... - if((that.__ready_announce_requests || new Set()).size == 0){ - delete that.__ready_announce_requests - } - // force start... - if(!that.isReady()){ - that.ready() + && !this.__ready_announce_timeout + && (this.__ready_announce_timeout = + setTimeout(function(){ + // cleanup... + delete this.__ready_announce_timeout + if((this.__ready_announce_requests || new Set()).size == 0){ + delete this.__ready_announce_requests + } + // force start... + if(!this.isReady()){ + // report... + this.logger + && this.logger.push('start') + .emit('forcing ready.') + .emit('stalled:', + this.__ready_announce_requested, + ...(this.__ready_announce_requests || [])) - // report... - that.logger - && that.logger.psuh('start') - .emit('forced ready.') - .emit('stalled:', - this.__ready_announce_requested, - ...[this.__ready_announce_requests || []]) - } - }, this.config['declare-ready-timeout']) + // force ready... + this.__ready = !!this.ready() + + // cleanup... + delete this.__ready_announce_requested + delete this.__ready_announce_requests + } + }.bind(this), this.config['declare-ready-timeout'])) // trigger the started event... this.started()