-1

I have an ASP.NET MVC application and I will need to execute a task every one minute.

  The task is: 
    -> Go to database 
    -> Check from Table 1 if a record has value = "something"
    -> Perform a task in my web application(submit content to a website) 
    -> Update Record in Table 2 
    -> Delete item from Table 1 
    -> Repeat

I'm thinking of building a desktop application so I can have more control over it and use some kind of library or Windows Scheduler for executing this task every minute.

I've found out about Quartz.NET library and using it on web applications and it seems cool but I'm a little concerned on using a scheduler in a web application.

What are your opinions?

Thanks

1
  • Perhaps you could put the task logic inside a Controller Action and then use the Windows Scheduler to keep on triggering that action every 1 minute using a powershell Invoke-Request command -- serverfault.com/a/829328 Commented Feb 13, 2020 at 10:02

3 Answers 3

0

If you are on MS SQL Server, it comes with it's own scheduler called Agent which can run SQL scripts on a schedule.

To run any program, Task Scheduler comes with Windows and is perfectly fine. You'll have to remember to deploy the task with your web application, but this is scriptable, so there should not be any insurmountable problems. I'd probably use a powershell script here instead of a desktop application so nothing needs to be compiled.

What are your concerns with "using a scheduler in a web application." ? The scheduled tasks won't have any touching points with the MVC web application.

0

I have heard excellent things about Hangfire, though I haven't used it for anything big myself. It can be used to run delayed and scheduled jobs. It works with SQL Server, Redis, PostgreSQL, Oracle, MySQL, Firebird, and others.

0

I have been running scheduled tasks in the background as part of an ASP.NET Core web app in production for a year now using FluentScheduler (https://github.com/fluentscheduler/FluentScheduler). It's handling 8-12 jobs all running on different schedules (every few minutes, every day, etc.) and haven't had too many issues.

I have also heard good things about Hangfire and Quartz.NET for the same purpose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.