Website timer for activating web service calls every hour

If I want to run a series of web service calls every hour. How can I do this from my web server?

I assume that there is a timer that needs to be deployed somewhere so that it counts, and when the time runs out, it will again use these web services and get the returned XML data that will be stored in the database. Then the timer is reset again.

+1
source share
4 answers

If you want to do this from an ASP.NET web application, check out the Quartz.NET Job Scheduler , it is perfect for this kind of thing.

Otherwise, you can run a standalone application as a Windows service with a timer or a console application as a scheduled Windows task.

+4
source

You can use the System.Threading.Timer class with the Start event application in global.asax:

protected static Timer timer; protected void Application_Start(Object sender, EventArgs e) { timer = new Timer(MyRoutineToCall, null, TimeSpan.FromHours(1), TimeSpan.FromHours(1)); } protected void MyRoutineToCall(Object state) { // do your stuff here } 
+2
source

Why not just use cron? Cron is set up for this kind of thing.

0
source

Windows Task Scheduler may be what you need.

0
source

Source: https://habr.com/ru/post/1442076/


All Articles