From 21b7f2372fef6744f4cfaf32e5318c3e33a86a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owski?= Date: Wed, 22 Dec 2021 01:55:19 +0100 Subject: [PATCH] Support both number and string for memoryLimitInMB --- netlify-functions/src/main/scala/feral/netlify/Context.scala | 5 ++++- .../src/main/scala/feral/netlify/facade/Context.scala | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/netlify-functions/src/main/scala/feral/netlify/Context.scala b/netlify-functions/src/main/scala/feral/netlify/Context.scala index e00242ae..c217ec7e 100644 --- a/netlify-functions/src/main/scala/feral/netlify/Context.scala +++ b/netlify-functions/src/main/scala/feral/netlify/Context.scala @@ -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, diff --git a/netlify-functions/src/main/scala/feral/netlify/facade/Context.scala b/netlify-functions/src/main/scala/feral/netlify/facade/Context.scala index 231c0d58..78d29de3 100644 --- a/netlify-functions/src/main/scala/feral/netlify/facade/Context.scala +++ b/netlify-functions/src/main/scala/feral/netlify/facade/Context.scala @@ -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