mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 18:22:49 +08:00
Fix tracing wrapper. (#966)
This commit is contained in:
parent
176a7bb960
commit
ad00f20a23
@ -79,12 +79,12 @@ namespace Ocelot.Middleware.Pipeline
|
|||||||
var diagnosticListener = (DiagnosticListener)app.ApplicationServices.GetService(typeof(DiagnosticListener));
|
var diagnosticListener = (DiagnosticListener)app.ApplicationServices.GetService(typeof(DiagnosticListener));
|
||||||
var middlewareName = ocelotDelegate.Target.GetType().Name;
|
var middlewareName = ocelotDelegate.Target.GetType().Name;
|
||||||
|
|
||||||
OcelotRequestDelegate wrapped = context =>
|
OcelotRequestDelegate wrapped = async context =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Write(diagnosticListener, "Ocelot.MiddlewareStarted", middlewareName, context);
|
Write(diagnosticListener, "Ocelot.MiddlewareStarted", middlewareName, context);
|
||||||
return ocelotDelegate(context);
|
await ocelotDelegate(context);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user