This repository has been archived by the owner on Jul 10, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed
handler.ts
to load user handler over Thundra core library ins…
…tead of loading itself
- Loading branch information
Serkan ÖZAL
committed
Jun 1, 2020
1 parent
7b1ef3b
commit 59a7a21
Showing
4 changed files
with
22 additions
and
13 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
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,19 +1,11 @@ | ||
'use strict'; | ||
|
||
import { loadHandler } from './runtime/RuntimeSupport'; | ||
import Utils from './plugins/utils/Utils'; | ||
import { EnvVariableKeys } from './Constants'; | ||
const thundra = require('@thundra/core'); | ||
const thundraWrapper = thundra(); | ||
|
||
const HANDLER_ENV_VAR = 'thundra_agent_lambda_handler'; | ||
|
||
const thundra = require('@thundra/core')(); | ||
const userHandler = loadHandler( | ||
Utils.getEnvVar(EnvVariableKeys.LAMBDA_TASK_ROOT), | ||
Utils.getEnvVar(HANDLER_ENV_VAR), | ||
); | ||
|
||
const wrappedUserFunc = thundra(userHandler); | ||
const userHandler = thundra.loadUserHandler(); | ||
const wrappedUserHandler = thundraWrapper(userHandler); | ||
|
||
exports.wrapper = (event: any, context: any, callback: any) => { | ||
return wrappedUserFunc(event, context, callback); | ||
return wrappedUserHandler(event, context, 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