Skip to content

Commit

Permalink
Remove Task.Run block in async method
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethmyhra committed Mar 19, 2021
1 parent 4546499 commit 4f1f3fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Spark.Engine/Service/AsyncFhirService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,10 @@ public async Task<FhirResponse> HandleInteractionAsync(Entry interaction)
return await CreateAsync(interaction).ConfigureAwait(false);
case Bundle.HTTPVerb.DELETE:
var resourceStorage = GetFeature<IResourceStorageService>();
var current = await resourceStorage.GetAsync(interaction.Key.WithoutVersion())
.ConfigureAwait(false);
var current = await resourceStorage.GetAsync(interaction.Key.WithoutVersion()).ConfigureAwait(false);
if (current != null && current.IsPresent)
{
return Task.Run(() => DeleteAsync(interaction)).GetAwaiter().GetResult();
return await DeleteAsync(interaction).ConfigureAwait(false);
}
// FIXME: there's no way to distinguish between "successfully deleted"
// and "resource not deleted because it doesn't exist" responses, all return NoContent.
Expand Down

0 comments on commit 4f1f3fd

Please sign in to comment.