未验证 提交 d72782dd 编写于 作者: K kezhenxu94 提交者: GitHub

Fix thread local context not init in Django and add upload command to Makefile (#19)

上级 4c2109fd
......@@ -48,6 +48,9 @@ install: gen
package: clean gen
python3 setup.py sdist bdist_wheel
upload-test: package
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
clean:
rm -rf browser common language_agent management profile service_mesh_probe
rm -rf skywalking_python.egg-info dist build
......
......@@ -120,6 +120,8 @@ _thread_local.context = None
def get_context() -> SpanContext:
if not hasattr(_thread_local, 'context'):
_thread_local.context = None
_thread_local.context = _thread_local.context or (SpanContext() if agent.connected() else NoopContext())
return _thread_local.context
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册