I am building a web application in asp.net MVC and am thinking how I can get certain conditional tests to happen regularly.
Currently I am planning on having a page such as /utility/runJobs that will have a function in it that will test the whole site for dates meeting certain conditions etc..
I would then trigger this page from a service or other trigger service.
I would probably run this every min incase new notifications had to be sent out, or a Log item had to be written, or a status updated.
Can anyone suggest a better way of doing this.
EDIT___________
Imagine how the notification emails for ebay are sent?
I guess that the badges on stack over flow are tested when a user comes to the sit开发者_Go百科e, and only for that user.
If you are planning to write a Service to trigger your Jobs then I would suggest that you execute your jobs in your Service.
With MVC you have hopefully already separated you logic from you Views so it should be easy to implement the service.
First big protip: what you are looking to do shouldn't require a single web page. Or, what you really need to think about here is services, command line apps and queuing, not having a page that gets hit once a minute.
精彩评论