Updated worker to show upsert issue messages.
This commit is contained in:
@@ -8,6 +8,7 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System.CommandLine;
|
||||
using System.Text;
|
||||
|
||||
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
@@ -16,10 +17,13 @@ builder.Configuration
|
||||
.SetBasePath(builder.Environment.ContentRootPath)
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
||||
.AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: true)
|
||||
// Add user secrets (works regardless of environment when optional: true)
|
||||
.AddUserSecrets(typeof(Program).Assembly, optional: true)
|
||||
.AddEnvironmentVariables();
|
||||
|
||||
if (builder.Environment.IsDevelopment())
|
||||
{
|
||||
builder.Configuration.AddUserSecrets(typeof(Program).Assembly, optional: true);
|
||||
}
|
||||
|
||||
// Pull the connection string from config (appsettings or secrets or env)
|
||||
string connectionString = builder.Configuration.GetConnectionString("AppDb")
|
||||
?? throw new InvalidOperationException("Missing ConnectionStrings:AppDb");
|
||||
@@ -137,4 +141,6 @@ schemaDumpCommand.SetAction(async (parseResult, cancellationToken) =>
|
||||
|
||||
rootCommand.Add(schemaDumpCommand);
|
||||
|
||||
Console.OutputEncoding = Encoding.UTF8;
|
||||
|
||||
return await rootCommand.Parse(args).InvokeAsync();
|
||||
Reference in New Issue
Block a user