| | |
| | | using WIDESEAWCS_Core.Extensions; |
| | | using WIDESEAWCS_Core.Filter; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.LogHelper; |
| | | using WIDESEAWCS_Core.Middlewares; |
| | | using WIDESEAWCS_QuartzJob.QuartzExtensions; |
| | | using WIDESEAWCS_QuartzJob.Seed; |
| | | using WIDESEAWCS_SignalR; |
| | | using WIDESEAWCS_Tasks; |
| | | using WIDESEAWCS_WCSServer.Filter; |
| | | |
| | | var builder = WebApplication.CreateBuilder(args); |
| | | |
| | | int workerThreads = Environment.ProcessorCount * 8; |
| | | int completionThreads = Environment.ProcessorCount; |
| | | ThreadPool.SetMaxThreads(workerThreads, completionThreads); |
| | | |
| | | AppDomain.CurrentDomain.FirstChanceException += (sender, e) => |
| | | { |
| | | bool flag = e.Exception.TargetSite?.DeclaringType?.Namespace?.StartsWith("WIDESEA") == true; |
| | | |
| | | if (e.Exception is not OperationCanceledException && flag) |
| | | { |
| | | string folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Log\\Exception"); |
| | | Exception ex = e.Exception; |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.Append("错误信息:"); |
| | | builder.Append(ex.Message); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("错误源:"); |
| | | builder.Append(ex.Source); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("错误堆栈:"); |
| | | builder.Append(ex.StackTrace); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("错误类型:"); |
| | | builder.Append(ex.GetType().ToString()); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("错误方法:"); |
| | | builder.Append(ex.TargetSite?.ToString()); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append(Environment.NewLine); |
| | | |
| | | QuartzLogger.WriteLogToFile($"Error_全局错误", builder.ToString()); |
| | | } |
| | | }; |
| | | |
| | | if (!HslCommunication.Authorization.SetAuthorizationCode("95f1611d-633c-46ea-b03a-38ede1629f74")) |
| | | { |
| | |
| | | builder.Services.AddIpPolicyRateLimitSetup(builder.Configuration);//IPLimit限流 启动服务 |
| | | |
| | | builder.Services.AddScoped<UseServiceDIAttribute>(); |
| | | builder.Services.AddScoped<CommonConveyorLineJob>(); |
| | | |
| | | builder.Services.AddSession(); |
| | | |
| | |
| | | app.MapHubs(); |
| | | app.MapControllers(); |
| | | |
| | | app.Run(); |
| | | app.Run(); |