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

43 lines
946 B

using Autofac;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Job;
using log4net;
using Quartz;
using Quartz.Impl.Triggers;
using Repository.System;
namespace Service.Job;
[Scope]
public class TestJob : IMyJob
{
private static readonly ILog Log = LogManager.GetLogger(typeof(TestJob));
private SysConfigRepository SysConfigRepository = AppInfo.Container.Resolve<SysConfigRepository>();
public JobKey GetJobKey()
{
return JobKey.Create("default", JobKey.DefaultGroup);
}
public ITrigger GetTrigger()
{
return new CronTriggerImpl("d", "d", "0/5 * * * * ?");
}
public Task Execute(IJobExecutionContext context)
{
try
{
Log.Info($"{SysConfigRepository.GetHashCode()}");
}
catch (Exception e)
{
Log.Error(e);
}
return Task.CompletedTask;
}
}