quartz.net

how to inject quartz's job with ninject?

落爺英雄遲暮 提交于 2019-11-27 21:38:18
I use ninject and quartz.net in my application and I want to inject job with ninject,But I do not know how to ,because all I know is that jobdetail is created by class of Jobimpl instead of an instance,such as: JobBuilder.Create<SomeJob>() Does anyone know how? You'll have to implement an Quartz.Spi.IJobFactory - which uses an IResolutionRoot to create the job (see below for implementation). Then configure the scheduler to use it: Quartz.IScheduler.JobFactory = kernel.Get<NinjectJobFactory>(); (or, alternatively: Quartz.IScheduler.JobFactory = new NinjectJobFactory(kernel); ) public class

Get all jobs in Quartz.NET 2.0

大城市里の小女人 提交于 2019-11-27 17:45:30
I've setup my AdoJobStore on the server and all my jobs are running perfectly. Now I am writing a remote client to manage all my jobs. Scheduling new jobs is straightforward enough, but I can't seem to retrieve a list of existing jobs in version 2.0. All the resources I found did something like the following. var groups = sched.JobGroupNames; for (int i = 0; i < groups.Length; i++) { string[] names = sched.GetJobNames(groups[i]); for (int j = 0; j < names.Length; j++) { var currentJob = sched.GetJobDetail(names[j], groups[i]); } } The problem I'm facing is that GetJobNames has been removed,

How can I set the number of threads in the Quartz.NET threadpool?

岁酱吖の 提交于 2019-11-27 16:39:06
问题 I've seen in this tutorial section of the Quartz.NET documentation that it should be possible to define the maximum number of threads the Quartz scheduler is going to use. In my special case I want to set this number to 1. But in the API doc I couldn't find a way to access the threadpool instance my scheduler is using and to set any properties on it. Currently my code looks like this: ISchedulerFactory schedFact = new StdSchedulerFactory(); IScheduler scheduler = schedFact.GetScheduler();

Cron expression to be executed every 45 minutes

假装没事ソ 提交于 2019-11-27 16:27:29
I want a cron expression which fires every 45 minutes. According to the documentation, I have created this 0 0/45 * * * ? expression. But it is fired in a pattern like 12:00, 12:45, 13:00, 13:45, 14:00. But what I expect and want is to be fired at 12:00, 12:45, 13:30, 14:15. What am I missing? Cron is not meant to solve such problems. It defines the exact date and times, when a trigger must be fired, not intervals. Use a simple schedule instead: TriggerBuilder.Create() .StartAt(startDate) .WithSimpleSchedule( simpleScheduleBuilder => simpleScheduleBuilder.WithIntervalInMinutes(45)) .Build();

How do I switch from Log4Net to NLog in Quartz.Net?

本小妞迷上赌 提交于 2019-11-27 15:16:10
My company's standard logging tool is NLog. I'm trying to introduce Quartz.net and was asked if it could use NLog instead of Log4Net. I know I can recompile to use NLog, but I'd like to do it from the configuration files if at all possible. LeftyX Assuming that you're using Quartz.net 1.0.3. you have to add a reference to the following assemblies: Common.Logging Common.Logging.NLog NLog Then you have to add the following configuration in your application's config file: <configuration> <configSections> <sectionGroup name="common"> <section name="logging" type="Common.Logging

Quartz.NET scheduler doesn't fire jobs/triggers once deployed

半世苍凉 提交于 2019-11-27 13:46:43
INTRODUCTION I'm using Quartz.Net on an ASP.Net framework 4, webforms web site. Basically, the user should have the hability to fire manually a batch script that asynchronously processes thousands of records stored on a database. The user can stop or pause at any time, adjust some variables, and continue if needed with the process (remaining records). The code is done and working locally (developer machine, win7, vs2010, sql server express 2008 R2). It was also tested on a local server (win server 2008 R2, sql server express 2008 R2). It works fine on both enviroments, tested with all the code

Constructor injection with Quartz.NET and Simple Injector

元气小坏坏 提交于 2019-11-27 11:34:17
Currently I am writing a service using Quartz.NET to schedule the running of it. I was wondering if anyone has any experience of using constructor injection with Quartz.NET and Simple Injector. Below is essentially what I wish to achieve public class JobImplementation: IJob { private readonly IInjectedClass injectedClass; public JobImplementation(IInjectedClass _injectedClass) { injectedClass = _injectedClass } public void Execute(IJobExecutionContext _context) { //Job code } According to this blog post , you would need to implement a custom IJobFactory , like this: public class

How to start Quartz in ASP.NET Core?

こ雲淡風輕ζ 提交于 2019-11-27 10:58:18
I have the following class public class MyEmailService { public async Task<bool> SendAdminEmails() { ... } public async Task<bool> SendUserEmails() { ... } } public interface IMyEmailService { Task<bool> SendAdminEmails(); Task<bool> SendUserEmails(); } I have installed the latest Quartz 2.4.1 Nuget package as I wanted a lightweight scheduler in my web app without a separate SQL Server database. I need to schedule the methods SendUserEmails to run every week on Mondays 17:00,Tuesdays 17:00 & Wednesdays 17:00 SendAdminEmails to run every week on Thursdays 09:00, Fridays 9:00 What code do I need

Quartz.net - Repeat on day n, of every m months?

冷暖自知 提交于 2019-11-27 08:40:55
问题 Using Quartz.NET, I'm trying to create a trigger that: starts September 30th , repeats on the last day of every 5 months . be able to use ITrigger.GetFireTimeAfter() to compute/project the next fire times (UI feedback) Expected: 2017-9-30 2018-2-28 2018-7-31 2018-12-31 I thought I could use a CronTrigger (ie 0 0 0 L 9/5 ? * ) But the projected days are: 2017-9-30 2018-9-30 2019-9-30 Could not use CalendarIntervalTrigger either: For example, if you choose a start time that occurs on January

Use one windows service to execute jobs and two web applications to schedule jobs

谁都会走 提交于 2019-11-27 07:26:37
问题 I have one SQL Server database as the job store, two web applications that both can schedule jobs, and a Quartz.NET windows service to execute jobs. I want the two web applications to just schedule jobs, while the windows service just to execute jobs. Here comes the problem: If I create IScheduler instances in the two web applications and in the windows service, they will execute jobs at the same time, there can be conflicts. If I do not create IScheduler instances in the two web applications