mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Ensure stream is fully buffered.
Needs a more permanent fix for Very Large Streams.
This commit is contained in:
parent
9fb54b8958
commit
986461f6fe
@ -151,10 +151,11 @@ export class InMemoryResourceStore implements ResourceStore {
|
||||
// Note: when converting to a complete ResourceStore and using readable-stream
|
||||
// object mode should be set correctly here (now fixed due to Node 10)
|
||||
const source = this.store[path];
|
||||
const streamInternal = new PassThrough({ writableObjectMode: true, readableObjectMode: true });
|
||||
const streamOutput = new PassThrough({ writableObjectMode: true, readableObjectMode: true });
|
||||
source.data.pipe(streamInternal);
|
||||
const objectMode = { writableObjectMode: true, readableObjectMode: true };
|
||||
const streamOutput = new PassThrough(objectMode);
|
||||
const streamInternal = new PassThrough({ ...objectMode, highWaterMark: Number.MAX_SAFE_INTEGER });
|
||||
source.data.pipe(streamOutput);
|
||||
source.data.pipe(streamInternal);
|
||||
|
||||
source.data = streamInternal;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user