some cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-10-09 17:54:14 +03:00
parent c8cddf8ae5
commit 979d8667e8

View File

@ -234,7 +234,7 @@ var CollectionActions = actions.Actions({
// XXX should this queue already running calls or a specific collection???? // XXX should this queue already running calls or a specific collection????
// ...I think yes!! // ...I think yes!!
// XXX do we need timeuts here???? // XXX do we need timeouts here????
ensureCollection: ['- Collections/', ensureCollection: ['- Collections/',
core.doc`Ensure a collection exists and is consistent... core.doc`Ensure a collection exists and is consistent...
@ -270,12 +270,14 @@ var CollectionActions = actions.Actions({
var collection_data = this.collections[collection] var collection_data = this.collections[collection]
var handlers = this.collection_handlers var handlers = this.collection_handlers
// sync collection calls... // if a promise has not yet resolved/rejected, return it
// XXX do we need timeuts here???? // and do not start a new one...
// XXX do we need timeouts here????
if(!force && running[collection]){ if(!force && running[collection]){
return running[collection] return running[collection]
} }
// handle collection...
p = running[collection] = new Promise(function(resolve, reject){ p = running[collection] = new Promise(function(resolve, reject){
Promise Promise
.all(Object.keys(handlers) .all(Object.keys(handlers)