Remove async keyword from anon limiter fn

Signed-off-by: Matei David <matei.david.35@gmail.com>
This commit is contained in:
Matei David
2021-01-22 13:38:49 +00:00
parent db2328c885
commit 36bd49fa56
2 changed files with 4 additions and 6 deletions
@@ -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);
@@ -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 }),