quartz.net

Type initializer for Quartz.net throws an exception

房东的猫 提交于 2019-12-11 10:33:32
问题 I'm taking a look at Quartz.NET 2.0 beta 1. I'm using the first example code, in my own project, my code is: class Program { static void Main(string[] args) { // First we must get a reference to a scheduler ISchedulerFactory sf = new StdSchedulerFactory(); IScheduler sched = sf.GetScheduler(); // computer a time that is on the next round minute DateTimeOffset runTime = DateBuilder.EvenMinuteDate(DateTimeOffset.UtcNow); // define the job and tie it to our HelloJob class IJobDetail job =

Working with DateTimeOffset

自作多情 提交于 2019-12-11 09:36:40
问题 I have some problems understanding the DateTimeOffset... I am trying to create a simple-trigger for a Quartz-Job. There exists a triggerbuilder with which one can create such a trigger like this: var triggerbuilder = TriggerBuilder.Create() .WithIdentity(triggerName, ConstantDefinitions.InternalDefinitions.AdhocJobGroup) .StartAt(new DateTimeOffset(scheduledTime)); The scheduledTime is a DateTime. Let's say it is new DateTime(2014, 10, 15, 14, 0, 0); I live in a city which lies in the Central

Configure Quartz.Net to write in separate file using NLog

风流意气都作罢 提交于 2019-12-11 09:16:42
问题 This is my config for nlog. What i'm trying to achieve is to have Quartz logs in separate file. But checking the logs folder i find only scheduler log file. <targets> <target xsi:type="File" name="f" fileName="${basedir}/logs/log-${shortdate}.log.json" layout="${json}" /> <target xsi:type="File" name="scheduler" fileName="${basedir}/logs/log-${shortdate}.scheduler.log" layout="${message}" /> <target xsi:type="Console" name="console" layout="${longdate} ${uppercase:${level}} ${message}" /> <

c# .NET MVC 4 - How do I create Quartz jobs that use Ninject services?

六眼飞鱼酱① 提交于 2019-12-11 08:33:50
问题 I am using .NET MVC 4. All services are injected using Ninject. I am trying to schedule a job using Quartz. Right now, jobs are registered in Global.asax as follows: Global.asax : protected void Application_Start() { // ... configuration stuff ScheduledJobs.RegisterJobs(); } ScheduleJobs.cs has the ScheduledJobs class, which creates jobs with triggers and adds them to a standard schedule. In ScheduleJobs.cs : public class ScheduledJobs { public static void RegisterJobs() { IScheduler

Quartz.net trigger doesn't fire

给你一囗甜甜゛ 提交于 2019-12-11 08:30:23
问题 I have two tasks. The first should be execute once an hour, and the second every day at 12:00. The trigger of the first task works fine, but the second fires only if it is created a few minutes before the target time. What am I doing wrong? The configuration of the first: IJobDetail job = JobBuilder.Create<WatchJob>() .WithIdentity("Job_1", "First") .WithDescription("Job_1_First") .UsingJobData("AppData", JsonConvert.SerializeObject("Job_1_First")) .Build(); ITrigger trigger = TriggerBuilder

Quartz.Net multiple calendars

痞子三分冷 提交于 2019-12-11 08:06:33
问题 Using Quartz.Net and have a need for the same trigger to have multiple Calendars, whilst this isn't possible I'm looking for suggestions of how to achieve similar functionality. For example I want to run the job in X minutes and exlude 9-10am every day but be able to block out other times during the day as required. The code below works fine but if I want to block out another time interval I can't see a way of doing it. ISchedulerFactory schedFact = new StdSchedulerFactory(); sched =

How to check if a particular job is running in quartz scheduler c#

本小妞迷上赌 提交于 2019-12-11 07:53:29
问题 I am using quartz scheduler to schedule a job of writing to a file depending on user input on basis of triggers. I want to check if the job is still running in the stop() method. How can I check if the job is still running? public class JobScheduler { static StdSchedulerFactory schedulerFactory = new StdSchedulerFactory(); public IScheduler scheduler = schedulerFactory.GetScheduler().Result; public void start() { scheduler.Start(); IJobDetail jobDetail = JobBuilder.Create<FileWritingJob>()

Quartz.net error in web config file

有些话、适合烂在心里 提交于 2019-12-11 05:51:24
问题 Trying to get quartz to log in ms sql server but getting error in web config file. </configSections> <quartz> <add key="quartz.scheduler.instanceName" value="SchedulingPOC"/> <add key="quartz.scheduler.instanceId" value="SchedulingPOC"/> <!-- Configure Thread Pool --> <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" /> <add key="quartz.threadPool.threadCount" value="10" /> <add key="quartz.threadPool.threadPriority" value="Normal" /> <!-- Configure Job Store -->

Azure - multiple worker roles - Couldn't store job: Unable to store Job: 'job6', because one already exists with this identification

自闭症网瘾萝莉.ら 提交于 2019-12-11 03:55:54
问题 I'm using Quartz.Net scheduler to schedule my jobs. I'm using ADOJOBSTORE to store all these values. Couldn't store job: Unable to store Job: 'job6', because one already exists with this identification When I try to run it throwing the above error. Any idea? ILog log = LogManager.GetLogger(typeof(CronTrigger)); log.Info("------- Initializing -------------------"); // First we must get a reference to a scheduler ISchedulerFactory sf = new StdSchedulerFactory(); IScheduler sched = sf

context.Trigger.JobDataMap values via xml configuration

别说谁变了你拦得住时间么 提交于 2019-12-11 03:18:53
问题 In quartz_jobs.xml, I can set some parameters for the job..... <job> <name>MyJob</name> <group>MyJob</group> <description>My Job</description> <job-type>MyAssembly.MyJob, MyAssembly</job-type> <durable>true</durable> <recover>false</recover> <job-data-map> <entry> <key>JobMapDataKeyOne</key> <value>JobMapDataValueOne</value> </entry> <entry> <key>JobMapDataKeyTwo</key> <value>JobMapDataValueTwo</value> </entry> </job-data-map> </job> and here is the code: public class MyJob: IJob { public