using Admin.Core.Common; using Aucma.Core.Tasks; using log4net; using Microsoft.AspNetCore.Builder; using System; namespace Admin.Core.Extensions { /// ///定时服务 /// public static class AucmaTaskMildd { private static readonly ILog log = LogManager.GetLogger(typeof(AucmaTaskMildd)); public static void AucmaTaskMildds(this IApplicationBuilder app, IAucamTaskService aucamTaskService) { if (app == null) throw new ArgumentNullException(nameof(app)); try { if (Appsettings.app("Middleware", "AucamTask", "Enabled").ObjToBool()) { /// aucamTaskService.AucamTaskAsync(); Console.WriteLine("澳柯玛定时服务已开启"); } } catch (Exception e) { log.Error($"An error was reported when starting the job service.\n{e.Message}"); throw; } } } }