|
@ -39,6 +39,17 @@ const configure = (socket) => { |
|
|
emitter.on('parse.error', ({ filepath, columns, error }) => { |
|
|
emitter.on('parse.error', ({ filepath, columns, error }) => { |
|
|
socket.emit('parse.error', { event: 'parse.error', message: 'Erreur lors du traitement' }); |
|
|
socket.emit('parse.error', { event: 'parse.error', message: 'Erreur lors du traitement' }); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
let processed = 0; |
|
|
|
|
|
let limit = 10000; |
|
|
|
|
|
emitter.on('parse.data', ({ filepath, columns, data, index }) => { |
|
|
|
|
|
processed++; |
|
|
|
|
|
|
|
|
|
|
|
if ( processed == limit ) { |
|
|
|
|
|
socket.emit('parse.data', { message: `[${index} lignes] traités` }); |
|
|
|
|
|
processed = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
module.exports = configure; |
|
|
module.exports = configure; |