40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Hncore.Infrastructure.Common;
|
|
using Microsoft.AspNetCore;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace Hncore.Pass.PaymentCenter
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
|
|
{
|
|
LogHelper.Fatal("未捕获的异常", e.ExceptionObject.ToString());
|
|
};
|
|
|
|
TaskScheduler.UnobservedTaskException += (_, ev) =>
|
|
{
|
|
LogHelper.Fatal("未捕获的异常", ev.Exception);
|
|
};
|
|
|
|
CreateWebHostBuilder(args).Build().Run();
|
|
}
|
|
|
|
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
|
WebHost.CreateDefaultBuilder(args)
|
|
.UseStartup<Startup>()
|
|
.ConfigureKestrel((context, options) =>
|
|
{
|
|
options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(20);
|
|
options.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(20);
|
|
});
|
|
}
|
|
} |