diff --git a/Viewer/features/core.js b/Viewer/features/core.js index b1699d8e..f5e2e319 100755 --- a/Viewer/features/core.js +++ b/Viewer/features/core.js @@ -2922,8 +2922,11 @@ var TaskActions = actions.Actions({ queue .on('tasksAdded', function(evt, t){ this.logger && this.logger.emit('added'+suffix, t) }) - .on('taskCompleted', function(evt, t){ - this.logger && this.logger.emit('done'+suffix, t) }) + // NOTE: t can be anything including an array, so to + // avoid confusion we wrap it in an array this + // one call means one emit... + .on('taskCompleted', function(evt, t, r){ + this.logger && this.logger.emit('done'+suffix, [t]) }) .on('taskFailed', function(evt, t, err){ this.logger && this.logger.emit('skipped'+suffix, t, err) }) .on('stop', function(){ diff --git a/Viewer/features/sharp.js b/Viewer/features/sharp.js index 6326cf6a..2c9e19ce 100755 --- a/Viewer/features/sharp.js +++ b/Viewer/features/sharp.js @@ -700,6 +700,10 @@ var SharpActions = actions.Actions({ && logger.emit('skipped', `${gid} / ${size}`) }) })) })], + // XXX BUG: .cacheMetadata('all'): runs out of call stack on very + // large indexes... + // ...can't yet see/find any recursion... + // .....at least the fail is fast and quiet =) // XXX add support for offloading the processing to a thread/worker... // XXX revise logging and logger passing... cacheMetadata: ['- Sharp|Image/', @@ -756,9 +760,7 @@ var SharpActions = actions.Actions({ // parse args... function(queue, image, ...args){ var that = this - var force = false - if(image === true){ - var [force, image, ...args] = arguments } + var force = args[0] == 'force' // expand images... var images = image == 'all' ? @@ -783,7 +785,6 @@ var SharpActions = actions.Actions({ return [ images, - force, ...args, ] }, function(image, force, logger){ @@ -908,7 +909,7 @@ module.Sharp = core.ImageGridFeatures.Feature({ // indexes... // XXX this needs to be run in the background... // XXX this is best done in a thread - [['loadIndex' + [['loadIndex', 'loadImages', 'loadNewImages'], 'cacheMetadata: "all"'],