From 429a38fca66e5b1730e80fbe086fd932e328642b Mon Sep 17 00:00:00 2001 From: Marco van den Oever Date: Wed, 30 Oct 2024 22:28:48 +0100 Subject: [PATCH] Added async init to host base --- src/30-Host/Wtq.Host.Base/WtqHostBase.cs | 7 +++++++ 1 file changed, 7 insertions(+) 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);