diff --git a/src/server.ts b/src/server.ts index 4410e91..30c3b80 100644 --- a/src/server.ts +++ b/src/server.ts @@ -277,7 +277,7 @@ export function startServer(s3: AWS.S3, config: Config, onDoneInitializing: () = res.statusCode = StatusCode.OK; // tell Bazel the PUT succeeded sendResponse(req, res, size, { startTime, awsPaused }); safeUnlinkSync(pth); - } else if (pendingUploadBytes + size > config.asyncUpload.maxPendingUploadMB * 1024 * 1024) { + } else if (config.asyncUpload.enabled && pendingUploadBytes + size > config.asyncUpload.maxPendingUploadMB * 1024 * 1024) { winston.info(`Not uploading ${s3key}, because there are already too many pending uploads`); res.statusCode = StatusCode.OK; // tell Bazel the PUT succeeded sendResponse(req, res, size, { startTime, awsPaused });