| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Hosting; |
| | | using Microsoft.OpenApi.Models; |
| | | using NLog; |
| | | using Rhea.Common; |
| | | using Sundial; |
| | | using System; |
| | |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using Tiger.Api.Controllers; |
| | | using Tiger.Api.DbCache; |
| | | using Tiger.IBusiness; |
| | | using Tiger.IBusiness.Utility; |
| | | |
| | |
| | | BizConfig.InitConfig(bizConfig, DI.Resolve<ILanguage>().GetDictionary()); |
| | | |
| | | //加载配置文件 |
| | | NLog.LogManager.LoadConfiguration("nlog.config").GetCurrentClassLogger(); |
| | | NLog.LogManager.Setup().LoadConfigurationFromFile("nlog.config").GetCurrentClassLogger(); |
| | | app.UseMiddleware<LogMiddleware>(); |
| | | |
| | | app.UseSwagger(); |
| | |
| | | //开启服务总线 |
| | | DI.Resolve<IServicesBus>().StartServices(app.ApplicationServices.GetService<ISchedulerFactory>()); |
| | | //开启DB缓存自动更新 |
| | | DI.Resolve<IDbCacheBus>().StartAutoUpdate(); |
| | | //DI.Resolve<IDbCacheBus>().StartAutoUpdate(); |
| | | DbCacheBus.StartAutoUpdate(); |
| | | //开启MQTT服务 |
| | | MQTTHelper.Start(); |
| | | } |
| | |
| | | /// </summary> |
| | | public void DeleteLogs() |
| | | { |
| | | DirectoryInfo di = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "\\Logs"); |
| | | DirectoryInfo di = new (AppDomain.CurrentDomain.BaseDirectory + "\\Logs"); |
| | | if(di.Exists) |
| | | { |
| | | var logFiles = di.GetFiles("*.log", SearchOption.AllDirectories); |