-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change module exports and upgrade vercel to latest release (#1005)
* bugfix: change module exports and upgrade vercel to latest release * bugfix: webhook.verify is now asynchronous
- Loading branch information
1 parent
92a0d8a
commit f8f8981
Showing
11 changed files
with
57 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { handle } from './syncer/handler'; | ||
|
||
// eslint-disable-next-line | ||
module.exports.handler = async (event: any, context: any, callback: any): Promise<any> => { | ||
export const handler = async (event: any, context: any, callback: any): Promise<void> => { | ||
await handle(); | ||
return callback(); | ||
callback(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
import { scaleUp } from './scale-runners/scale-up'; | ||
import { scaleDown } from './scale-runners/scale-down'; | ||
import { scaleUp as scaleUpAction } from './scale-runners/scale-up'; | ||
import { scaleDown as scaleDownAction } from './scale-runners/scale-down'; | ||
import { SQSEvent, ScheduledEvent, Context } from 'aws-lambda'; | ||
|
||
module.exports.scaleUp = async (event: SQSEvent, context: Context, callback: any) => { | ||
export const scaleUp = async (event: SQSEvent, context: Context, callback: any): Promise<void> => { | ||
console.dir(event, { depth: 5 }); | ||
try { | ||
for (const e of event.Records) { | ||
await scaleUp(e.eventSource, JSON.parse(e.body)); | ||
await scaleUpAction(e.eventSource, JSON.parse(e.body)); | ||
} | ||
return callback(null); | ||
|
||
callback(null); | ||
} catch (e) { | ||
console.error(e); | ||
return callback('Failed handling SQS event'); | ||
callback('Failed handling SQS event'); | ||
} | ||
}; | ||
|
||
module.exports.scaleDown = async (event: ScheduledEvent, context: Context, callback: any) => { | ||
export const scaleDown = async (event: ScheduledEvent, context: Context, callback: any): Promise<void> => { | ||
try { | ||
scaleDown(); | ||
return callback(null); | ||
scaleDownAction(); | ||
callback(null); | ||
} catch (e) { | ||
console.error(e); | ||
return callback('Failed'); | ||
callback('Failed'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { handle as githubWebhook } from './webhook/handler'; | ||
import { handle } from './webhook/handler'; | ||
|
||
module.exports.githubWebhook = async (event: any, context: any, callback: any) => { | ||
const statusCode = await githubWebhook(event.headers, event.body); | ||
return callback(null, { | ||
export const githubWebhook = async (event: any, context: any, callback: any): Promise<void> => { | ||
const statusCode = await handle(event.headers, event.body); | ||
callback(null, { | ||
statusCode: statusCode, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,5 +92,4 @@ describe('handler', () => { | |
expect(resp).toBe(200); | ||
expect(sendActionRequest).toBeCalled(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters