C# Fluent调度程序不';不要在特定的时间运行
我正在使用C# Fluent调度程序不';不要在特定的时间运行,c#,asp.net-mvc-4,scheduler,fluent,C#,Asp.net Mvc 4,Scheduler,Fluent,我正在使用Fluent调度器构建一个在特定时间运行的后台线程,在我的程序中,是凌晨4点。管理员可以在以后更改该时间。这是我的密码: Global.asax.cs TaskManager.Initialize(new ParseService(4, 0)); public class ParseService : Registry { public ParseService(int hour, int minute) { Sched
Fluent调度器
构建一个在特定时间运行的后台线程,在我的程序中,是凌晨4点。管理员可以在以后更改该时间。这是我的密码:
Global.asax.cs
TaskManager.Initialize(new ParseService(4, 0));
public class ParseService : Registry
{
public ParseService(int hour, int minute)
{
Schedule(ParseHelper.ParseData).ToRunEvery(1).Days().At(hour, minute);
}
}
ParseService.cs
TaskManager.Initialize(new ParseService(4, 0));
public class ParseService : Registry
{
public ParseService(int hour, int minute)
{
Schedule(ParseHelper.ParseData).ToRunEvery(1).Days().At(hour, minute);
}
}
我预计它会在凌晨4点运行,但当时间到了,什么也没发生。我在
ParseData
函数的第一行中放了一个断点,它也没有命中。我的代码怎么了?请帮帮我。非常感谢。网站当时没有睡觉吗?经过一段时间的不活动后,它变为空闲。
如果是这样,您可以启动一个计划任务,例如创建一个webrequest,使其唤醒应用程序。任务计划程序初始化后的建议解决方案
while (!JobManager.RunningSchedules.Any())
{
Thread.Sleep(1000);
}
它应该使调度程序始终运行