From 21bd3506fec5047b77c4d46bd11acca5b0cdac1a Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Tue, 7 Dec 2021 11:06:23 +0100 Subject: [PATCH] Add missing await --- .../lambdas/runner-binaries-syncer/src/lambda.test.ts | 4 ++-- .../lambdas/runner-binaries-syncer/src/lambda.ts | 4 +--- .../lambdas/runner-binaries-syncer/src/syncer/syncer.ts | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.test.ts b/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.test.ts index ac927ef829..09086385d8 100644 --- a/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.test.ts +++ b/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.test.ts @@ -12,13 +12,13 @@ describe('Test scale up lambda wrapper.', () => { resolve(); }); }); - await expect(handler({}, {}, {})).resolves; + await expect(handler({}, {})).resolves; }); it('Scale without error should resolve2 . ', async () => { const mock = mocked(sync); mock.mockRejectedValue(new Error('')); - await expect(handler({}, {}, {})).resolves; + await expect(handler({}, {})).resolves; }); }); diff --git a/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.ts b/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.ts index f0193ed6d3..12d53f26e5 100644 --- a/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.ts +++ b/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.ts @@ -2,15 +2,13 @@ import { sync } from './syncer/syncer'; import { logger } from './syncer/logger'; // eslint-disable-next-line -export async function handler(event: any, context: any, callback: any): Promise { +export async function handler(event: any, context: any): Promise { logger.setSettings({ requestId: context.awsRequestId }); logger.debug(JSON.stringify(event)); try { await sync(); - callback(null); } catch (e) { logger.warn('Ignoring error:', e); - callback(e); } } diff --git a/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/syncer/syncer.ts b/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/syncer/syncer.ts index d7478cf5d9..4787bf7602 100644 --- a/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/syncer/syncer.ts +++ b/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/syncer/syncer.ts @@ -125,7 +125,7 @@ export async function sync(): Promise { const currentVersion = await getCachedVersion(s3, cacheObject); logger.debug('latest: ' + currentVersion); if (currentVersion === undefined || currentVersion != actionRunnerReleaseAsset.name) { - uploadToS3(s3, cacheObject, actionRunnerReleaseAsset); + await uploadToS3(s3, cacheObject, actionRunnerReleaseAsset); } else { logger.debug('Distribution is up-to-date, no action.'); }