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