asp.net-mvc - Quartz.net irregularly scheduled tasks
问题描述
I'll pull the times as a list from the database. It will give me the hours as [09:00,11:30,15.16,21.45,23:30]. I need to create a trigger during these hours. I don't know how many hours will come. I need to trigger how many times there are in the list. According to the code I've made now, I trigger it every 5 minutes. I couldn't find any examples of this on the internet. How can I solve this?
var scheduler = await StdSchedulerFactory.GetDefaultScheduler();
if (!scheduler.IsStarted)
{
await scheduler.Start();
}
var job = JobBuilder.Create<QuartzTask>()
.WithIdentity("ExecuteTaskServiceCallJob1", "group1")
.Build();
var trigger = TriggerBuilder.Create()
.WithIdentity("ExecuteTaskServiceCallTrigger1", "group1").WithSimpleSchedule(x => x.WithIntervalInMinutes(15).RepeatForever()).StartNow().Build();
await scheduler.ScheduleJob(job, trigger);
解决方案
推荐阅读
- selenium - 无法从 API 响应中找到重复的元素
- c++ - 当作为函数的参数给出时,全局变量不更新
- sas - 标记患者在第一次事件后失访
- java - 包不只存在于库模块的 mainactivity 文件中的某些包
- count - openoffice calc 组合的出现次数
- php - 无法从服务器目录文件显示图像
- ruby-on-rails - 使用每个 Ruby Rails 在数组上计算相同的值
- c# - 无法将侦听器注册到 System.Diagnostics.Tracing.EventSource
- javascript - 状态 ReactJS 和渲染方法
- gradle - 如何定义地图
在 build.gradle