修改启动文件
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2023-12-05 17:50:57 +08:00
parent edbcabace6
commit 9bb5266d61
1 changed files with 14 additions and 7 deletions

View File

@ -27,6 +27,9 @@ using LogDashboard;
var builder = WebApplication.CreateBuilder(args);
#region 环境变量设置,以及部署运维平台
//以配置文件为准,否则 从url中取环境值(服务以命令行传递参数启动,配置文件配置了就不需要传递环境参数)
@ -58,13 +61,9 @@ else
Log.Logger.Warning($"当前部署平台环境OSX or FreeBSD");
}
#endregion
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseEnvironment(enviromentName)
.ConfigureAppConfiguration((hostContext, config) =>
{
@ -79,8 +78,7 @@ builder.Host.UseEnvironment(enviromentName)
containerBuilder.RegisterModule<AutofacModuleSetup>();
})
.UseWindowsService().UseSerilog();
#endregion
#region 配置服务
@ -259,7 +257,16 @@ await hangfireJobService.InitHangfireJobTaskAsync();
#endregion
try
{
app.Run();
}
catch (Exception e)
{
Log.Logger.Error(e.InnerException is null ? e.Message + e.StackTrace : e.InnerException?.Message + e.InnerException?.StackTrace);
}