Skip to content

Commit

Permalink
Fixed middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
spetz committed Nov 3, 2019
1 parent 844300b commit 845d3dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/DShop.Common/Authentication/Extensions.cs
Expand Up @@ -34,7 +34,8 @@ public static void AddJwt(this IServiceCollection services)
ValidIssuer = options.Issuer,
ValidAudience = options.ValidAudience,
ValidateAudience = options.ValidateAudience,
ValidateLifetime = options.ValidateLifetime
ValidateLifetime = options.ValidateLifetime,
ClockSkew = TimeSpan.Zero
};
});
}
Expand Down
6 changes: 2 additions & 4 deletions src/DShop.Common/Jaeger/JaegerStagedMiddleware.cs
Expand Up @@ -22,7 +22,7 @@ public JaegerStagedMiddleware(ITracer tracer)
public override string StageMarker => RawRabbit.Pipe.StageMarker.MessageDeserialized;


public override Task InvokeAsync(IPipeContext context, CancellationToken token = new CancellationToken())
public override async Task InvokeAsync(IPipeContext context, CancellationToken token = new CancellationToken())
{
var correlationContext = (ICorrelationContext) context.GetMessageContext();
var messageType = context.GetMessageType();
Expand All @@ -34,16 +34,14 @@ public override Task InvokeAsync(IPipeContext context, CancellationToken token =

try
{
return Next.InvokeAsync(context, token);
await Next.InvokeAsync(context, token);
}
catch(Exception ex)
{
span.SetTag(Tags.Error, true);
span.Log(ex.Message);
}
}

return Next.Next.InvokeAsync(context, token);
}

private IScope BuildScope(Type messageType, string serializedSpanContext)
Expand Down

0 comments on commit 845d3dc

Please sign in to comment.