Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint committed Dec 24, 2024
1 parent 67c7371 commit 0445e13
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions runtime/wasmhost/wasmhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/hypermodeinc/modus/runtime/logger"
"github.com/hypermodeinc/modus/runtime/middleware"
"github.com/hypermodeinc/modus/runtime/plugins"
"github.com/hypermodeinc/modus/runtime/timezones"
"github.com/hypermodeinc/modus/runtime/utils"

"github.com/rs/zerolog"
Expand Down Expand Up @@ -112,7 +113,12 @@ func (host *wasmHost) GetModuleInstance(ctx context.Context, plugin *plugins.Plu
wErr := io.MultiWriter(buffers.StdErr(), wErrorLog)

// Get the time zone to pass to the module instance.
tz := ctx.Value(utils.TimeZoneContextKey).(string)
var timeZone string
if tz, ok := ctx.Value(utils.TimeZoneContextKey).(string); ok {
timeZone = tz
} else {
timeZone = timezones.GetLocalTimeZone()
}

// Configure the module instance.
// Note, we use an anonymous module name (empty string) here,
Expand All @@ -126,7 +132,7 @@ func (host *wasmHost) GetModuleInstance(ctx context.Context, plugin *plugins.Plu
WithSysWalltime().WithSysNanotime().
WithRandSource(rand.Reader).
WithStdout(wOut).WithStderr(wErr).
WithEnv("TZ", tz).
WithEnv("TZ", timeZone).
WithEnv("CLAIMS", jwtClaims)

// Instantiate the plugin as a module.
Expand Down

0 comments on commit 0445e13

Please sign in to comment.