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

Commit

Permalink
only require userland CLS when needed (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud authored and mayurkale22 committed Mar 21, 2019
1 parent 04f1fee commit 4eaf539
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 4eaf539

Please sign in to comment.