Skip to content

Commit

Permalink
Merge pull request #4237 from systeminit/fix(lang-js)--Set-env-vars-b…
Browse files Browse the repository at this point in the history
…efore-we-iterate-on-beforeFuncs

fix(lang-js): Set env vars before we iterate on beforeFuncs
  • Loading branch information
stack72 authored Jul 26, 2024
2 parents 8d3e37c + fa3c4b5 commit f004358
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions bin/lang-js/src/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ export async function executeFunction(kind: FunctionKind, request: Request) {

for (const beforeFunction of request.before || []) {
await executor(ctx, beforeFunction, FunctionKind.Before, before);
}

// Set process environment variables, set from requestStorage
{
const requestStorageEnv = rawStorageRequest().env();
for (const key in requestStorageEnv) {
process.env[key] = requestStorageEnv[key];
// Set process environment variables, set from requestStorage
{
const requestStorageEnv = rawStorageRequest().env();
for (const key in requestStorageEnv) {
process.env[key] = requestStorageEnv[key];
}
}
}

Expand Down

0 comments on commit f004358

Please sign in to comment.