我有ASP.NET核心应用程序,我使用Quartz.NET进行恢复工作,它每60秒运行一次我的TestMethod(),工作正常。
我需要有时间手动运行这份工作。如何强迫Quartz.NET在手动运行60秒后进行下一次重传调用?
这是我需要完成的:
00:01:00 -> Automatic run of TestMethod();
00:02:00 -> Automatic run of TestMethod();
00:02:10 -> Manual run of TestMethod();
00:03:10 -> Automatic run of TestMeth
我有一个在特定时间定期发送电子邮件的MVC应用程序。虽然我可以通过使用Quartz.NET在Debugging模式下管理它,但由于回收应用程序池等原因,它在发布到IIS Server时不起作用。因此,我认为这是一个普遍的问题,我认为使用database trigger或windows service来触发电子邮件发送。那么,最好的选择是什么呢?实际上,如果在数据库端创建触发器比只运行脚本简单得多,我更喜欢这样。但是,如果有更好的选择,您能告诉我如何将其集成到我的MVC应用程序中吗?
注意:我使用MSSQL Server 2008作为数据库,使用Windows Server 2008发布应用程序
假设以下情况:
我有一个视图模型,它应该在特定的延迟之后自动关闭。
就像这样:
public AutoCloseViewModel : ViewModelBase
{
public void Close()
{
/* perform actions necessary to close
the view model and its associated view */
}
protected override OnActivate()
{
// schedule job that calls Clo
我想为我的网站创建一个到期系统,其中用户支付一定的时间,然后他们的帐户到期。我需要的是一种让它们过期的方法。我想有一个方法,每天运行一次,并禁用任何超过到期日期的用户,但我不知道如何实现,因为到目前为止我所做的一切都依赖于一个连接的人。这段代码应该独立于访问该站点的人。
编辑:
谢谢你所有的点子。
我想提一下,我不能仅仅在SQL服务器上完成所有的任务。我还需要移动和修改文件。
如下所示:
public void checkExpire()
{
// much more code to check the expiration goes here
if (DateTime.No
我想在Quartz.Net中重复一个作业,直到它正确完成。我尝试了这样的东西:
using Common.Logging;
using Quartz;
using System;
using System.Threading.Tasks;
namespace MyNamespace
{
[DisallowConcurrentExecution]
public class ExampleJob : IJob
{
private readonly ILog _log = LogManager.GetLogger(typeof(ExampleJob));
我试图为我的.NET MVC应用程序实现一个逻辑,在这个逻辑中,我将在以下基础上触发我的应用程序中的预定任务:
First scheduled task to run from 00 am to 1 am in the morning
Second scheduled task to run from 1:10 am to 08:00 am in the morning
Third scheduled task to run from 8:15 am to 11:15 pm every 1 hour
每年365天都会这样.
我可以在.NET或外部库中使用哪种机制来用很少的代码来实现这一最简单