Skip to content

Commit

Permalink
refactor: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Aug 22, 2022
1 parent bc9184e commit dc8c46a
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/lambda/LambdaFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,26 @@ export default class LambdaFunction {

const { handler, name, package: functionPackage = {} } = functionDefinition

const memorySize =
// this._executionTimeout = null
this.#functionKey = functionKey
this.#functionName = name
this.#handler = handler

this.#memorySize =
functionDefinition.memorySize ||
provider.memorySize ||
DEFAULT_LAMBDA_MEMORY_SIZE

const runtime =
this.#region = provider.region

this.#runtime =
functionDefinition.runtime || provider.runtime || DEFAULT_LAMBDA_RUNTIME

const timeout =
this.#timeout =
(functionDefinition.timeout ||
provider.timeout ||
DEFAULT_LAMBDA_TIMEOUT) * 1000

// this._executionTimeout = null
this.#functionKey = functionKey
this.#functionName = name
this.#handler = handler
this.#memorySize = memorySize
this.#region = provider.region
this.#runtime = runtime
this.#timeout = timeout

this.#verifySupportedRuntime()

const env = {
Expand Down Expand Up @@ -141,17 +139,17 @@ export default class LambdaFunction {
handler,
layers: functionDefinition.layers || [],
provider,
runtime,
runtime: this.#runtime,
serverlessPath,
servicePackage: servicePackage.artifact
? resolve(servicepath, servicePackage.artifact)
: undefined,
servicePath: servicepath,
timeout,
timeout: this.#timeout,
}

this.#handlerRunner = new HandlerRunner(funOptions, options, env)
this.#lambdaContext = new LambdaContext(name, memorySize)
this.#lambdaContext = new LambdaContext(name, this.#memorySize)
}

#startExecutionTimer() {
Expand Down

0 comments on commit dc8c46a

Please sign in to comment.