Skip to content

Commit

Permalink
Only decode environment variables when we want to
Browse files Browse the repository at this point in the history
 
Refs #1941, #1834, 7995083
  • Loading branch information
thewilkybarkid committed Sep 20, 2024
1 parent fc91b02 commit cd7eb2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DeprecatedServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as L from 'logger-fp-ts'
import { DeprecatedEnvVars, DeprecatedLoggerEnv, type DeprecatedSleepEnv } from './Context.js'
import { decodeEnv } from './env.js'

export const makeDeprecatedEnvVars = decodeEnv(process)()
export const makeDeprecatedEnvVars = decodeEnv(process)

export const makeDeprecatedLoggerEnv = Effect.gen(function* () {
const env = yield* DeprecatedEnvVars
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pipe(
Logger.withMinimumLogLevel(LogLevel.Debug),
Effect.provide(Logger.replaceEffect(Logger.defaultLogger, DeprecatedLogger)),
Effect.provideServiceEffect(DeprecatedLoggerEnv, makeDeprecatedLoggerEnv),
Effect.provideService(DeprecatedEnvVars, makeDeprecatedEnvVars),
Effect.provideServiceEffect(DeprecatedEnvVars, Effect.sync(makeDeprecatedEnvVars)),
Effect.scoped,
NodeRuntime.runMain({ disablePrettyLogger: true }),
)

0 comments on commit cd7eb2d

Please sign in to comment.