Release v2.1.65: safe MCP updates and measured upload scheduling
CI / verify (push) Canceled after 0s

This commit is contained in:
Sucukdeluxe committed 2026-10-16 05:36:42 +02:00
1 parent e3c03d195e
commit 1ff552fc40
26 files changed
+552 -92

No files matched your search

+3 -4
View File
@@ -1,4 +1,5 @@
const fs = require('fs');
const { statUploadFile, readUploadFile } = require('./upload-file-io');
const path = require('path');
const crypto = require('crypto');
const { request } = require('undici');
@@ -383,7 +384,7 @@ class DoodstreamUploader {
*/
async upload(filePath, progressCb, signal, throttle) {
const fileName = path.basename(filePath);
const fileSize = fs.statSync(filePath).size;
const fileSize = (await statUploadFile(filePath)).size;
// Get upload server
const uploadUrl = await this._getUploadServer();
@@ -413,13 +414,11 @@ class DoodstreamUploader {
const epilogueBuf = Buffer.from(epilogue, 'utf-8');
const totalSize = preambleBuf.length + fileSize + epilogueBuf.length;
const CHUNK_SIZE = 1024 * 1024;
let bytesRead = 0;
async function* generate() {
yield preambleBuf;
const fileStream = fs.createReadStream(filePath, { highWaterMark: CHUNK_SIZE });
for await (const chunk of fileStream) {
for await (const chunk of readUploadFile(filePath, signal)) {
if (signal && signal.aborted) throw new Error('Aborted');
if (throttle) await throttle.consume(chunk.length, signal);
bytesRead += chunk.length;