MCPcopy
hub / github.com/prisma/prisma / getActive

Function getActive

packages/query-plan-executor/src/tracing/collector.ts:54–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53export const tracingCollectorContext = {
54 getActive(): TracingCollector | undefined {
55 const collector = context.active().getValue(TRACING_COLLECTOR_KEY)
56
57 if (collector === undefined) {
58 return undefined
59 }
60
61 if (collector instanceof TracingCollector) {
62 return collector
63 }
64
65 throw new Error('Active tracing collector is not an instance of TracingCollector')
66 },
67
68 withActive<T>(collector: TracingCollector, fn: () => T): T {
69 return context.with(context.active().setValue(TRACING_COLLECTOR_KEY, collector), fn)

Callers

nothing calls this directly

Calls 1

getValueMethod · 0.80

Tested by

no test coverage detected