Skip to content

Commit

Permalink
Remove await from support bundle autofac construction (Azure#3453)
Browse files Browse the repository at this point in the history
Autofac inconsistently breaks if you await before resolving something.
  • Loading branch information
lfitchett authored and dylanbronson committed Aug 25, 2020
1 parent c29e0d6 commit 6d05cc1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ protected override void Load(ContainerBuilder builder)

// Task<IRequestHandler> - SupportBundleRequestHandler
builder.Register(
async c =>
c =>
{
await Task.Yield();
return new SupportBundleRequestHandler(c.Resolve<IModuleManager>().GetSupportBundle, c.Resolve<IRequestsUploader>(), this.iotHubHostName) as IRequestHandler;
IRequestHandler handler = new SupportBundleRequestHandler(c.Resolve<IModuleManager>().GetSupportBundle, c.Resolve<IRequestsUploader>(), this.iotHubHostName);
return Task.FromResult(handler);
})
.As<Task<IRequestHandler>>()
.SingleInstance();
Expand Down

0 comments on commit 6d05cc1

Please sign in to comment.