diff --git a/packages/techdocs-common/src/stages/publish/awsS3.ts b/packages/techdocs-common/src/stages/publish/awsS3.ts index e7014df967..9a4852df03 100644 --- a/packages/techdocs-common/src/stages/publish/awsS3.ts +++ b/packages/techdocs-common/src/stages/publish/awsS3.ts @@ -150,10 +150,8 @@ export class AwsS3Publish implements PublisherBase { Body: fileContent, }; - // Rate limit the concurrent execution of file uploads to batches of 10 - const uploadFile = limiter(async () => - this.storageClient.putObject(params), - ); + // Rate limit the concurrent execution of file uploads to batches of 10 (per publish) + const uploadFile = limiter(() => this.storageClient.putObject(params)); uploadPromises.push(uploadFile); } await Promise.all(uploadPromises); diff --git a/packages/techdocs-common/src/stages/publish/googleStorage.ts b/packages/techdocs-common/src/stages/publish/googleStorage.ts index d8fe0b7d26..8a06a07cb0 100644 --- a/packages/techdocs-common/src/stages/publish/googleStorage.ts +++ b/packages/techdocs-common/src/stages/publish/googleStorage.ts @@ -113,8 +113,8 @@ export class GoogleGCSPublish implements PublisherBase { const entityRootDir = `${entity.metadata.namespace}/${entity.kind}/${entity.metadata.name}`; const destination = `${entityRootDir}/${relativeFilePath}`; // GCS Bucket file relative path - // Rate limit the concurrent execution of file uploads to batches of 10 - const uploadFile = limiter(async () => + // Rate limit the concurrent execution of file uploads to batches of 10 (per publish) + const uploadFile = limiter(() => this.storageClient .bucket(this.bucketName) .upload(filePath, { destination }),