mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
fixed a race condition in .exportIndex(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3076044ccf
commit
46aa45593c
@ -1688,6 +1688,8 @@ progress:not(value)::-webkit-progress-bar {
|
|||||||
padding: 2px;
|
padding: 2px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: rgba(0,0,0,0.1);
|
background: rgba(0,0,0,0.1);
|
||||||
|
|
||||||
|
z-index: 4000;
|
||||||
}
|
}
|
||||||
.progress-container:hover {
|
.progress-container:hover {
|
||||||
background: rgba(0,0,0,0.8);
|
background: rgba(0,0,0,0.8);
|
||||||
|
|||||||
@ -1927,28 +1927,17 @@ var FileSystemWriterActions = actions.Actions({
|
|||||||
var from = (img_base || base_dir) +'/'+ preview_path
|
var from = (img_base || base_dir) +'/'+ preview_path
|
||||||
var to = path +'/'+ preview_path
|
var to = path +'/'+ preview_path
|
||||||
|
|
||||||
|
// XXX use queue for progress reporting...
|
||||||
|
logger && logger.emit('queued', to)
|
||||||
|
|
||||||
// XXX do we queue these or let the OS handle it???
|
// XXX do we queue these or let the OS handle it???
|
||||||
// ...needs testing, if node's fs queues the io
|
// ...needs testing, if node's fs queues the io
|
||||||
// internally then we do not need to bother...
|
// internally then we do not need to bother...
|
||||||
// XXX
|
queue.push(copy(from, to)
|
||||||
queue.push(ensureDir(pathlib.dirname(to))
|
|
||||||
// XXX do we need error handling here???
|
|
||||||
.catch(function(err){
|
|
||||||
logger && logger.emit('error', err) })
|
|
||||||
.then(function(){
|
.then(function(){
|
||||||
// XXX
|
logger && logger.emit('done', to) })
|
||||||
logger && logger.emit('queued', to)
|
.catch(function(err){
|
||||||
|
logger && logger.emit('error', err)
|
||||||
return copy(from, to)
|
|
||||||
// XXX do we need to have both of this
|
|
||||||
// and the above .catch(..) or can
|
|
||||||
// we just use the one above (after
|
|
||||||
// .then(..))
|
|
||||||
.then(function(){
|
|
||||||
logger && logger.emit('done', to) })
|
|
||||||
// XXX do we need error handling here???
|
|
||||||
.catch(function(err){
|
|
||||||
logger && logger.emit('error', err) })
|
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,14 +147,13 @@ $(function(){
|
|||||||
ig.logger = ig.logger || {
|
ig.logger = ig.logger || {
|
||||||
root: true,
|
root: true,
|
||||||
message: null,
|
message: null,
|
||||||
|
log: null,
|
||||||
|
|
||||||
emit: function(e, v){
|
emit: function(e, v){
|
||||||
var msg = this.message
|
var msg = this.message
|
||||||
|
var log = this.log = this.log || []
|
||||||
|
|
||||||
// console...
|
// report progress...
|
||||||
console.log(' '+ ((msg && msg.concat('')) || []).join(': '), e, v)
|
|
||||||
|
|
||||||
// progress...
|
|
||||||
// XXX HACK -- need meaningful status...
|
// XXX HACK -- need meaningful status...
|
||||||
if(e == 'queued'
|
if(e == 'queued'
|
||||||
|| e == 'found'){
|
|| e == 'found'){
|
||||||
@ -163,7 +162,19 @@ $(function(){
|
|||||||
} else if(e == 'loaded' || e == 'done' || e == 'written'
|
} else if(e == 'loaded' || e == 'done' || e == 'written'
|
||||||
|| e == 'skipping' || e == 'index'){
|
|| e == 'skipping' || e == 'index'){
|
||||||
ig.showProgress(msg || ['Progress', e], '+1')
|
ig.showProgress(msg || ['Progress', e], '+1')
|
||||||
|
|
||||||
|
// XXX STUB...
|
||||||
|
} else if(e == 'error' ){
|
||||||
|
ig.showProgress(['Error'].concat(msg), '+0', '+1')
|
||||||
|
console.log(' '+ (msg || []).join(': ') + ':', e, v)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// console...
|
||||||
|
console.log(' '+ (msg || []).join(': ') + ':', e, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX
|
||||||
|
//log.push([msg, e, v])
|
||||||
},
|
},
|
||||||
|
|
||||||
push: function(msg){
|
push: function(msg){
|
||||||
@ -174,6 +185,7 @@ $(function(){
|
|||||||
var logger = Object.create(this)
|
var logger = Object.create(this)
|
||||||
logger.root = false
|
logger.root = false
|
||||||
logger.message = logger.message == null ? [msg] : logger.message.concat([msg])
|
logger.message = logger.message == null ? [msg] : logger.message.concat([msg])
|
||||||
|
logger.log = this.log = this.log || []
|
||||||
|
|
||||||
return logger
|
return logger
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user