Skip to content

Commit

Permalink
Added async init to host base
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingpie committed Oct 30, 2024
1 parent 9e01ef2 commit 429a38f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/30-Host/Wtq.Host.Base/WtqHostBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using System.IO;
using System.Threading.Tasks;
using Wtq.Configuration;
using Wtq.Utils;
using Wtq.Utils.AsyncInit;

namespace Wtq.Host.Base;

Expand Down Expand Up @@ -54,6 +56,9 @@ public WtqHostBase()
.AddWtqCore();
ConfigureServices(opt);
opt
.AddAsyncInitializable();
})
.UseSerilog()
.Build();
Expand All @@ -63,6 +68,8 @@ public async Task RunAsync()
{
try
{
await _host.Services.InitializeAsync().NoCtx();

await _host
.RunAsync()
.ConfigureAwait(false);
Expand Down

0 comments on commit 429a38f

Please sign in to comment.