For a work project, I am working on a task that gives me a C #. Net Windows service that 24/7 The program will essentially schedule files between different locations (based on a given path and a regex) - / to HTTP, network path and FTP Administrator will schedule these jobs through an administrative page in ASP.NET , Where all jobs will be stored in the database. It seems that the hardest part is determining these jobs - working on a certain day at a certain time is very simple to work, but it also needs to be strong enough to work every day, every week On the day, every fixed day of the month, or every few seconds / minute I have also concluded that the easiest way to store this scheduling information is by using Cron Si Aks (http://adminschoice.com/crontab-quick-reference) will have to use the database.
The application has a timer to check the database for every 10 minutes to change, but I have the main issue that is about to get to work again - I think One option is to get everything in just every 10 minutes, and check each individual line to see if they are due to execution. But I think this is a very inefficient and technically lazy way - how can you go about this?
I know that the Windows Scheduled Task will be an easy way, but it seems like my boss does not want
> If you do not have a large number of tasks to keep track of, you can keep the priority queue of all the functions in memory. In the nodes the record key (from the database) and the next updated date / time will be calculated.
When the program starts, read each record from the database and build your priority queue. After creating the queue, look at the date of the first item and set the timer to wake up at that time. When the timer awakens, execute all the tasks that are currently in the future, have been rescheduled for their next update date / time, to find the next item that needs updating and to wake up at that time the timer set on.
To handle the amendments, you may have a web application that modifies things to notify your service. You will have to cancel the existing timer and resume, but you will have to read the whole database except the startup.
He said, I agree with @Oeded: To understand how to use your master, Windows Scheduled Task If he does not like that interface, you can use your web app (or a web service The app communicates) can talk to the Windows Task Scheduler API. The codeplex has a cover:
Comments
Post a Comment