Github:https://github.com/zzhi/jobengine
Cross-platform job framework based on Quartz.net
Quartz.net (https://github.com/quartznet/quartznet/tree/features/netcore11) also supports cross-platform, because NuGet cannot install Quartz-dotnetcore Dll.
So I downloaded this solution directly, removed some useless code, created the project JobServer directly on the solution, and referenced it by adding a reference Quartz-dotnetcore
How do I create a new job?
To create the TestJob.cs in the 1,jobs project, the code is as Follows:
[DisallowConcurrentExecution]public class TestJob : IJob{ public Task Execute(IJobExecutionContext context) { Log.Information(DateTime.Now.ToString()); return Task.FromResult(0); }}TestJob作业仅仅打印当前时间。
2, Modify the Quartz_jobs.xml of the Jobservice project as Follows:
<job> <name>TestJob</name> <group>TestJobGroup</group> <description>TestJob</description> <job-type>Jobs.TestJob, Jobs</job-type> <durable>true</durable> <recover>false</recover></job><trigger> <cron> <name>TestJobTrigger</name> <group>TestJobTriggerGroup</group> <job-name>TestJob</job-name> <job-group>TestJobGroup</job-group> <cron-expression>0/5 * * * * ?</cron-expression> </cron></trigger>
3, restart
Jobengine based on quartz.net cross-platform job framework