Skip to content

Instantly share code, notes, and snippets.

@Qard

Qard/fix.diff Secret

Last active May 12, 2016 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Qard/8b652eb1379c140d2db0d7e6a7efe8ad to your computer and use it in GitHub Desktop.
Save Qard/8b652eb1379c140d2db0d7e6a7efe8ad to your computer and use it in GitHub Desktop.
diff --git a/oboeware/middleware.py b/oboeware/middleware.py
index e3ac5d9..e10ab40 100644
--- a/oboeware/middleware.py
+++ b/oboeware/middleware.py
@@ -125,15 +125,10 @@ class OboeMiddleware(object):
result = self.wrapped_app(environ, wrapped_start_response)
except Exception:
- if oboe.Context.get_default().is_valid():
- endEvt.add_edge(oboe.Context.get_default())
self.send_end(ctx, endEvt, environ, threw_error=True)
raise
# check current TLS context and add to end event if valid
- if oboe.Context.get_default().is_valid():
- endEvt.add_edge(oboe.Context.get_default())
-
self.send_end(ctx, endEvt, environ, stats=stats)
return result
@@ -143,6 +138,10 @@ class OboeMiddleware(object):
if not ctx.is_valid():
return
+ def_ctx = oboe.Context.get_default()
+ if def_ctx.is_valid():
+ evt.add_edge(def_ctx)
+
evt.add_edge(ctx)
if stats:
evt.add_info("Profile", stats)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment