From 0ac44fbd4a2ceb3e11e38ab58bf217912f598279 Mon Sep 17 00:00:00 2001 From: Ryan Goetz Date: Tue, 11 Jun 2024 13:02:01 -1000 Subject: [PATCH 1/2] Free up some memory. --- src/UserCodeRunner.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/UserCodeRunner.ts b/src/UserCodeRunner.ts index 132a30c..084b59a 100644 --- a/src/UserCodeRunner.ts +++ b/src/UserCodeRunner.ts @@ -239,7 +239,10 @@ export class UserCodeRunner { await harnessModule.evaluate({ timeout, }); - return Result.Ok(context.__result); + const result = context.__result; + delete context.__args; + delete context.__result; + return Result.Ok(result); } catch (error: any) { return Result.Err([UserCodeRuntimeError.new(error as Error, await new SourceMapConsumer(sourceMap))]); } From c1d94b71ebc1ffa38a21c606deaf04a6e5b837bb Mon Sep 17 00:00:00 2001 From: Ryan Goetz Date: Tue, 11 Jun 2024 13:04:08 -1000 Subject: [PATCH 2/2] bumped the version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4617b08..c250f05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@nasa-jpl/aerie-ts-user-code-runner", - "version": "0.6.0", + "version": "0.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@nasa-jpl/aerie-ts-user-code-runner", - "version": "0.6.0", + "version": "0.7.0", "license": "MIT", "dependencies": { "source-map": "^0.7.4", diff --git a/package.json b/package.json index ad514d9..a4472aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nasa-jpl/aerie-ts-user-code-runner", - "version": "0.6.0", + "version": "0.7.0", "description": "A simple way to safely run user code written in Typescript.", "main": "build/UserCodeRunner.js", "type": "module",