quartz.net

Keep an nihbernate session open forever?

巧了我就是萌 提交于 2019-12-25 05:33:11
问题 I am using quartz and nhibernate and ran into a problem. Normally I have all my nhibernate sessions close on finish of a web request but I have a scheduler that starts on application start and I need to pass in a nhibernate session that I think should never be closed. I am unsure how to do that. Ninject public class NhibernateSessionFactoryProvider : Provider<ISessionFactory> { protected override ISessionFactory CreateInstance(IContext context) { var sessionFactory = new

Keep an nihbernate session open forever?

冷暖自知 提交于 2019-12-25 05:33:08
问题 I am using quartz and nhibernate and ran into a problem. Normally I have all my nhibernate sessions close on finish of a web request but I have a scheduler that starts on application start and I need to pass in a nhibernate session that I think should never be closed. I am unsure how to do that. Ninject public class NhibernateSessionFactoryProvider : Provider<ISessionFactory> { protected override ISessionFactory CreateInstance(IContext context) { var sessionFactory = new

Quartz for asp.net gets killed by iis server

空扰寡人 提交于 2019-12-24 15:56:41
问题 After reading this : http://www.mikesdotnetting.com/article/254/scheduled-tasks-in-asp-net-with-quartz-net I was quite happy i could publish a web site that would do scheduled task on itself... Or that was i tought. We did it, and it seems like IIS servers kill quartz just like any other scheduled task programmed inside web sites... Am i right ? 回答1: Yes, you are right. Basically - unless configured to do so, IIS will simply stop the application pool. Even if not, you put yourself into a

Quartz.NET and F# - SystemTime and KeyMatcher

99封情书 提交于 2019-12-24 14:45:02
问题 I am trying to work with Quartz.NET in F# and have run into a few issues with the fact that, while Quartz.NET is usable in F#, there does not seem to be much documentation on it, and I've had some difficulty with differences between it and what can find in C#. One issue I have currently run into is setting SystemTime such as shown in this question, Quartz.net + testing with SystemTime.UtcNow. I could be wrong, but I thought that the code in F# should be: SystemTime.Now = fun () -> DateTime

Schedule Quartz.NET trigger that executes once a week

邮差的信 提交于 2019-12-24 11:26:30
问题 I need to schedule Quartz.NET trigger so that it fires on every Monday at 09.00. So, I tried to use some features as below but I think it does not true as the parameters are not logical (It worked for daily scheduling, but after change to this it does not). So, could you please give an example that executes job weekly? ITrigger trigger = TriggerBuilder.Create() .WithDailyTimeIntervalSchedule (s => s.WithInterval(1, IntervalUnit.Week) .OnDaysOfTheWeek(DayOfWeek.Monday) .StartingDailyAt

In Quartz.net, how can I delay all scheduled jobs by a certain time span?

孤者浪人 提交于 2019-12-24 10:13:20
问题 I am using Quartz.net to schedule various API calls. The API I am using restricts the number of requests that can be made per time period and if that is exceeded, then my account is penalized for the next minute (no requests can be made). If I ever receive a notification that I have made too many requests and my account will be throttled for the next minute, I will need to ensure that no scheduled jobs fire during that period. How can I best delay firing of all scheduled jobs by a minute or

Quartz.NET 3.0 seems to launch all jobs in the same scope

◇◆丶佛笑我妖孽 提交于 2019-12-24 07:16:17
问题 I have a hard time using Quartz 3.0.7 with ASP.NET Core 2.2 after I have defined two jobs that rely on a scoped service (ScopedDataAccess) that is a wrapper upon my database context: services.AddScoped<IScopedDataAccess, ScopedDataAccess>(); services.AddDbContext<AggregatorContext>(opt => opt.UseSqlServer(configuration.GetConnectionString("Default"))); The issue is that both jobs receive the same instance of the scoped service (and thus the same database context), thus crashing the context

Quartz.net: Scheduled code not working after deployment automatically, working locally

余生颓废 提交于 2019-12-24 04:29:04
问题 I wish to send an email in a scheduled timeline (once in a week) from my MVC website. The code is working perfectly fine on the scheduled time when running through Visual Studio locally. However, not getting triggered after deployment to the server. It starts working when I hit the website once after deployment,as the Applciaiton_Start event gets fired where I trigger the Quartz engine. Is there a way by which I can trigger the engine without visiting the website even once. Does Quartz always

Configure Quartz.NET through a mixture of config file and constructor

夙愿已清 提交于 2019-12-24 03:34:10
问题 Is it possible to configure Quartz through a mixture of properties held in a config file (either quartz.properties or app.config / web.config) and also some via the StdSchedulerFactory constructor? I would like to pass the AdoJobStore connectionstring via the constructor, as it is dynamic depending on the environment, but the rest of the settings are static so would be better placed in a config file. I've tried passing in only the quartz.dataSource.myDS.connectionString property via the

Quartz: Does not implement interface member

醉酒当歌 提交于 2019-12-23 20:45:41
问题 I am using Quartz and using sample code and get the error: CS0738 'EmailJob' does not implement interface member IJob.Execute(IJobExecutionContext) . EmailJob.Execute(IJobExecutionContext) cannot implement IJob.Execute(IJobExecutionContext) because it does not > have the matching return type of Task . This is my first go at Quartz so any help would be kindly appreciated. public class EmailJob : IJob // <<<--- Error on this line { public void Execute(IJobExecutionContext context) { using (var