1
使用Quartz.Net我想手動觸發一個沒有時間表的工作(現在)。然而,作業在啓動時運行(我不想),然後無法響應手動觸發器(主要問題)。手動觸發一個不工作的工作
private IScheduler _scheduler;
public void SetupAndTestScheduler()
{
ISchedulerFactory sf = new StdSchedulerFactory();
_scheduler = sf.GetScheduler().Result;
_scheduler.Start();
_scheduler.ScheduleJob(
new JobDetailImpl(nameof(TestDataJob), typeof(TestDataJob)), null);
// manually trigger the job
_scheduler.TriggerJob(jobKey: new JobKey(nameof(TestDataJob)));
}
public class TestDataJob : IJob
{
public Task Execute(IJobExecutionContext context)
{
// blah blah blah
}
}
我在NetStandard2.0上,用Quartz.Net Alpha 3.我想知道這是否是版本3的問題?