summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--osprofiler/profiler.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/osprofiler/profiler.py b/osprofiler/profiler.py
index 001f62a..7b46b65 100644
--- a/osprofiler/profiler.py
+++ b/osprofiler/profiler.py
@@ -55,8 +55,9 @@ def init(hmac_key, base_id=None, parent_id=None):
:param parent_id: Used to build tree of traces.
:returns: Profiler instance
"""
- __local_ctx.profiler = _Profiler(hmac_key, base_id=base_id,
- parent_id=parent_id)
+ if get() is None:
+ __local_ctx.profiler = _Profiler(hmac_key, base_id=base_id,
+ parent_id=parent_id)
return __local_ctx.profiler