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.

33 lines
697 B

5 months ago
using Autofac;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Job;
using log4net;
using Repository.System;
namespace Service.Job;
[Scope]
5 months ago
public class TestJob : AbstractCronJob
5 months ago
{
private static readonly ILog Log = LogManager.GetLogger(typeof(TestJob));
private SysConfigRepository SysConfigRepository = AppInfo.Container.Resolve<SysConfigRepository>();
5 months ago
protected override Task Handle()
5 months ago
{
5 months ago
Log.Info("work");
return Task.CompletedTask;
5 months ago
}
5 months ago
protected override string Key()
5 months ago
{
5 months ago
return "test-job";
5 months ago
}
5 months ago
protected override string Cron()
5 months ago
{
5 months ago
return "0/2 * * * * ?";
5 months ago
}
}