Skip to content

Commit

Permalink
ConfigureAwait(false) på RequestHeaderHandler og hentPrintSertifikat
Browse files Browse the repository at this point in the history
  • Loading branch information
kristianenge committed Jun 28, 2016
1 parent 8305436 commit 2dce27f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override async Task<HttpResponseMessage> SendAsync(
{
request.Headers.Add("User-Agent", GetAssemblyVersion());
request.Headers.Add("SOAPAction", "\"\"");
return await base.SendAsync(request, cancellationToken);
return await base.SendAsync(request, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
}

private static string GetAssemblyVersion()
Expand Down
11 changes: 1 addition & 10 deletions Difi.Oppslagstjeneste.Klient/OppslagstjenesteKlient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;
using Common.Logging;
Expand Down Expand Up @@ -121,14 +120,6 @@ public IEnumerable<Person> HentPersoner(string[] personidentifikator, params Inf
}
}

public async Task<HttpResponseMessage> TestConfigureAwait(bool continueOnCapturedContext)
{
var httpClient = new HttpClient();
var result = await httpClient.GetAsync(new Uri("http://www.vg.no")).ConfigureAwait(continueOnCapturedContext);

return result;
}

/// <summary>
/// Forespørsel sendt fra Virksomhet for å hente Personer fra Oppslagstjenesten.
/// </summary>
Expand Down Expand Up @@ -188,7 +179,7 @@ public async Task<PrintSertifikatSvar> HentPrintSertifikatAsynkront()
{
RequestAndResponseLog.Debug(requestEnvelope.XmlDocument.OuterXml);
}
var responseDocument = await GetClient().SendAsync(requestEnvelope);
var responseDocument = await GetClient().SendAsync(requestEnvelope).ConfigureAwait(continueOnCapturedContext: false);
if (RequestAndResponseLog.IsDebugEnabled && OppslagstjenesteKonfigurasjon.LoggForespørselOgRespons)
{
RequestAndResponseLog.Debug(responseDocument.Envelope.InnerXml);
Expand Down

0 comments on commit 2dce27f

Please sign in to comment.