You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
949 B
C#

using Aucma.Core.PerfusionTask;
using Aucma.Core.TemperatureTask;
using log4net;
using Microsoft.AspNetCore.Builder;
using System;
namespace Admin.Core.Extensions.Middlewares
{
public static class PerfusionTaskMildd
{
private static readonly ILog log = LogManager.GetLogger(typeof(PerfusionTaskMildd));
public static void UsePerfusionTaskMildd(this IApplicationBuilder app, IAucamPerfusionService aucamPerfusionService)
{
if (app == null) throw new ArgumentNullException(nameof(app));
try
{
Console.WriteLine("灌注服务开启中...");
aucamPerfusionService.Execute();
Console.WriteLine("灌注服务已开启");
}
catch (Exception e)
{
log.Error($"An error was reported when starting the job service.\n{e.Message}");
throw;
}
}
}
}