mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
rate limiting to improve responsiveness during / after import
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const sax = require("sax");
|
||||
const stream = require('stream');
|
||||
const {Throttle} = require('stream-throttle');
|
||||
const log = require("../log");
|
||||
const utils = require("../utils");
|
||||
const sql = require("../sql");
|
||||
@@ -341,7 +342,10 @@ function importEnex(taskContext, file, parentNote) {
|
||||
const bufferStream = new stream.PassThrough();
|
||||
bufferStream.end(file.buffer);
|
||||
|
||||
bufferStream.pipe(saxStream);
|
||||
bufferStream
|
||||
// rate limiting to improve responsiveness during / after import
|
||||
.pipe(new Throttle({rate: 300000}))
|
||||
.pipe(saxStream);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user