From 979d8667e88113b7447e26ae4b4cd015a04ed349 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 9 Oct 2017 17:54:14 +0300 Subject: [PATCH] some cleanup... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/collections.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui (gen4)/features/collections.js b/ui (gen4)/features/collections.js index 7ec677cb..2d9454bd 100755 --- a/ui (gen4)/features/collections.js +++ b/ui (gen4)/features/collections.js @@ -234,7 +234,7 @@ var CollectionActions = actions.Actions({ // XXX should this queue already running calls or a specific collection???? // ...I think yes!! - // XXX do we need timeuts here???? + // XXX do we need timeouts here???? ensureCollection: ['- Collections/', core.doc`Ensure a collection exists and is consistent... @@ -270,12 +270,14 @@ var CollectionActions = actions.Actions({ var collection_data = this.collections[collection] var handlers = this.collection_handlers - // sync collection calls... - // XXX do we need timeuts here???? + // if a promise has not yet resolved/rejected, return it + // and do not start a new one... + // XXX do we need timeouts here???? if(!force && running[collection]){ return running[collection] } + // handle collection... p = running[collection] = new Promise(function(resolve, reject){ Promise .all(Object.keys(handlers)