diff --git a/src/30-Host/Wtq.Host.Base/WtqHostBase.cs b/src/30-Host/Wtq.Host.Base/WtqHostBase.cs index b3ea0a1..31ef096 100644 --- a/src/30-Host/Wtq.Host.Base/WtqHostBase.cs +++ b/src/30-Host/Wtq.Host.Base/WtqHostBase.cs @@ -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; @@ -54,6 +56,9 @@ public WtqHostBase() .AddWtqCore(); ConfigureServices(opt); + + opt + .AddAsyncInitializable(); }) .UseSerilog() .Build(); @@ -63,6 +68,8 @@ public async Task RunAsync() { try { + await _host.Services.InitializeAsync().NoCtx(); + await _host .RunAsync() .ConfigureAwait(false);