fluentscheduler

Cannot access a disposed object exception when method invoked by fluent scheduler job

◇◆丶佛笑我妖孽 提交于 2019-12-25 09:08:04
问题 I'm getting the "Cannot access a disposed object" exception during a call to a method that uses a DI-injected dbcontext (Transient-scoped)-- most likely the dbcontext was already disposed when being invoked. The method is being invoked as a job by fluent scheduler: JobManager.AddJob( () => ExecuteUpdateDbContext(), (s) => s.ToRunNow().AndEvery(60).Minutes() ); The ExecuteUpdateDbContext method works in any under circumstance except when used by fluent scheduler. Do I need to do something

How to use FluentScheduler library to schedule tasks in C#?

一个人想着一个人 提交于 2019-12-06 01:28:36
问题 I am trying to get familiar with C# FluentScheduler library through a console application (.Net Framework 4.5.2). Below is the code that have written: class Program { static void Main(string[] args) { JobManager.Initialize(new MyRegistry()); } } public class MyRegistry : Registry { public MyRegistry() { Action someMethod = new Action(() => { Console.WriteLine("Timed Task - Will run now"); }); Schedule schedule = new Schedule(someMethod); schedule.ToRunNow(); } } This code executes without any

Using FluentScheduler - ASP.NET Core MVC

非 Y 不嫁゛ 提交于 2019-12-04 21:00:56
问题 I currently have a simple website setup with ASP.NET Core MVC (.NET 4.6.1), and I would like to periodically do some processes like automatically send emails at the end of every day to the registered members. After doing some searching, I came across two common solutions - Quartz.NET and FluentScheduler. Based on this SO thread, I found the approach of using FluentScheduler more easier to digest and use for my simple task. After quickly implementing the following lines of code into my Program

How to use FluentScheduler library to schedule tasks in C#?

£可爱£侵袭症+ 提交于 2019-12-04 07:17:40
I am trying to get familiar with C# FluentScheduler library through a console application (.Net Framework 4.5.2). Below is the code that have written: class Program { static void Main(string[] args) { JobManager.Initialize(new MyRegistry()); } } public class MyRegistry : Registry { public MyRegistry() { Action someMethod = new Action(() => { Console.WriteLine("Timed Task - Will run now"); }); Schedule schedule = new Schedule(someMethod); schedule.ToRunNow(); } } This code executes without any errors but I don't see anything written on Console. Am I missing something here? You are using the