From 36bd49fa5603fd31c7218c8ecef3a50402a236ce Mon Sep 17 00:00:00 2001 From: Matei David Date: Fri, 22 Jan 2021 13:38:49 +0000 Subject: [PATCH] Remove async keyword from anon limiter fn Signed-off-by: Matei David --- packages/techdocs-common/src/stages/publish/awsS3.ts | 6 ++---- .../techdocs-common/src/stages/publish/googleStorage.ts | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) 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 }),