Skip to content

Commit

Permalink
chore: use Option.isNone in examples/http-server (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored Sep 13, 2024
1 parent afdd87f commit 3e5878f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"eslint.format.enable": true
}
6 changes: 3 additions & 3 deletions examples/http-server/src/Tracing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as NodeSdk from "@effect/opentelemetry/NodeSdk"
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http"
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base"
import { Config, Effect, Layer, Redacted } from "effect"
import { Config, Effect, Layer, Option, Redacted } from "effect"

export const TracingLive = Layer.unwrapEffect(
Effect.gen(function*() {
Expand All @@ -10,11 +10,11 @@ export const TracingLive = Layer.unwrapEffect(
Config.string("HONEYCOMB_DATASET"),
"stremio-effect"
)
if (apiKey._tag === "None") {
if (Option.isNone(apiKey)) {
const endpoint = yield* Config.option(
Config.string("OTEL_EXPORTER_OTLP_ENDPOINT")
)
if (endpoint._tag === "None") {
if (Option.isNone(endpoint)) {
return Layer.empty
}
return NodeSdk.layer(() => ({
Expand Down

0 comments on commit 3e5878f

Please sign in to comment.