chore: bump the trace packet size to be 1Mb (#22446)

This commit is contained in:
Pavel Feldman 2023-04-17 21:36:08 -04:00 committed by GitHub
parent 00df08b3cf
commit 9f661b710a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -40,8 +40,8 @@ class StreamImpl extends Readable {
this._channel = channel;
}
override async _read(size: number) {
const result = await this._channel.read({ size });
override async _read() {
const result = await this._channel.read({ size: 1024 * 1024 });
if (result.binary.byteLength)
this.push(result.binary);
else

View File

@ -73,7 +73,7 @@ export class ArtifactDispatcher extends Dispatcher<Artifact, channels.ArtifactCh
return;
}
try {
const readable = fs.createReadStream(localPath);
const readable = fs.createReadStream(localPath, { highWaterMark: 1024 * 1024 });
const stream = new StreamDispatcher(this, readable);
// Resolve with a stream, so that client starts saving the data.
resolve({ stream });
@ -94,7 +94,7 @@ export class ArtifactDispatcher extends Dispatcher<Artifact, channels.ArtifactCh
const fileName = await this._object.localPathAfterFinished();
if (!fileName)
return {};
const readable = fs.createReadStream(fileName);
const readable = fs.createReadStream(fileName, { highWaterMark: 1024 * 1024 });
return { stream: new StreamDispatcher(this, readable) };
}