Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

only require userland CLS when needed #435

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/opencensus-core/src/internal/cls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const useAsyncHooks: boolean = semver.satisfies(
process.version, '>=8'); //&&
// !!process.env.GCLOUD_TRACE_NEW_CONTEXT;

const cls: typeof CLS = useAsyncHooks ? require('./cls-ah') : CLS;
const cls: typeof CLS =
useAsyncHooks ? require('./cls-ah') : require('continuation-local-storage');


const TRACE_NAMESPACE = 'opencensus.io';
Expand Down