Getting all the active jobs from Quartz.NET scheduler -
Getting all the active jobs from Quartz.NET scheduler -
how can active jobs scheduled in quartz.net scheduler? tried getcurrentlyexecutingjobs() returning 0.
that method doesn't seem work. solution had found loop through jobs:
var groups = sched.jobgroupnames; (int = 0; < groups.length; i++) { string[] names = sched.getjobnames(groups[i]); (int j = 0; j < names.length; j++) { var currentjob = sched.getjobdetail(names[j], groups[i]); } }
when job found means still active. if set job durable, though, never deleted if there no associated trigger. in situation code works better:
var groups = sched.jobgroupnames; (int = 0; < groups.length; i++) { string[] names = sched.getjobnames(groups[i]); (int j = 0; j < names.length; j++) { var currentjob = sched.getjobdetail(names[j], groups[i]); if (sched.gettriggersofjob(names[j], groups[i]).count() > 0) { // still scheduled. } } }
update:
i did debugging see happens getcurrentlyexecutingjobs()
. matter of fact returns job beingness executed elements remove collection job executed. can check 2 functions jobtobeexecuted
, jobwasexecuted
in quartzscheduler class.
quartz.net
Comments
Post a Comment