Skip to content

Commit

Permalink
Support both number and string for memoryLimitInMB
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Dec 22, 2021
1 parent 4454014 commit 21b7f23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion netlify-functions/src/main/scala/feral/netlify/Context.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ object Context {
context.functionName,
context.functionVersion,
context.invokedFunctionArn,
context.memoryLimitInMB,
(context.memoryLimitInMB: Any) match {
case s: String => s.toInt
case i: Int => i
},
context.awsRequestId,
context.logGroupName,
context.logStreamName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private[netlify] sealed trait Context extends js.Object {
def functionName: String = js.native
def functionVersion: String = js.native
def invokedFunctionArn: String = js.native
def memoryLimitInMB: Int = js.native
def memoryLimitInMB: Int | String = js.native
def awsRequestId: String = js.native
def logGroupName: String = js.native
def logStreamName: String = js.native
Expand Down

0 comments on commit 21b7f23

Please sign in to comment.