From 0d95d547bda3f3015fd8a55d644ea9e3a0780409 Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Tue, 7 Jan 2025 14:23:59 -0600 Subject: [PATCH] fix(is): Only summarize usage in dev --- hosts/main/Program.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hosts/main/Program.cs b/hosts/main/Program.cs index 27ca14d6b..dc8d2b51b 100644 --- a/hosts/main/Program.cs +++ b/hosts/main/Program.cs @@ -38,12 +38,17 @@ try .ConfigureServices() .ConfigurePipeline(); - app.Lifetime.ApplicationStopping.Register(() => + if (app.Environment.IsDevelopment()) { - var usage = app.Services.GetRequiredService(); - Console.Write(Summary(usage)); - Console.ReadKey(); - }); + app.Lifetime.ApplicationStopping.Register(() => + { + var usage = app.Services.GetRequiredService(); + Console.Write(Summary(usage)); + { + Console.ReadKey(); + } + }); + } app.Run(); }