Quartz.net with MVC -
i initializing quartz inside application_start() in globals.asax.cs followed:
// construct scheduler factory ischedulerfactory schedfact = new stdschedulerfactory(); ischeduler sched = schedfact.getscheduler(); sched.start(); ijobdetail dailyusermailjob = new jobdetailimpl("dailyusermailjob", null, typeof(dailyusermail)); // fire every daye itrigger dailyusermailtrigger = new simpletriggerimpl("dailyusermailtrigger", 1, new timespan(1, 0, 0, 0)); sched.schedulejob(dailyusermailjob, dailyusermailtrigger);
the job should run once day, problem is, runs everytime hit website.
any ideas ?
the job should run once day
then shouldn't launched web application. should console application that's run on scheduler, or perhaps windows service.
a web application is, design, request/response system. it's not suited ongoing background tasks or scheduled offline tasks. because have no control on when application "starts" or "is running." web server controls when managing resources, , can stop/restart web application number of reasons.
Comments
Post a Comment