Recurring web process

I’m looking for the best way to handle a recurring web process.

This web app needs to send a report every week at a specified day of the week. How best to do this?

I usually store the timestamp for the next report and set a timer to check DateTime.Now against the stored timestamp. My timer period is usually something like 5 minutes.

It’s been mentioned elsewhere on the forum that long-period timers should be avoided, but i’ve never tried a timer longer than 10 minutes so I have no experience with that.

2 Likes

I find it’s easiest to put my report-generation routine into a standalone app and run it as a cronjob.

Edit: Another possibility is creating a special url in HandleURL to generate your report and then run curl as a cronjob to invoke it. Check Request.RemoteAddress to make sure it’s coming from the local machine for security, or build some kind of private key.