Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
just wondering about what best to do with task scheduling with an MVC app. There are packages like hangfire and fluentscheduler that handle scheduling tasks, now would it be best to put use these packages in their own web app or let it reside within the main web app?

So say sending/receiving mail, the main app can write a message to the database and the scheduled task will send these messages in batch from a seperate web app.
Posted
Comments
[no name] 2-Oct-14 20:48pm    
IMO, scheduled task do not have anything at all to do with web applications. Let your scheduled task be a scheduled task.
Zerotimedev 2-Oct-14 21:30pm    
i was trying to work out ways to make deployment easier basically, i dont think hosted servers will really allow for a batch file or windows service to run on their end. Any other ideas?

1 solution

Wrong. Not every problem is solved with a "web app".

A scheduled task is some process that runs at a set time. Most "scheduled tasks" are really just console applications that do a job and then quit.

A web application only executes when a web request comes in, NOT ON A SCHEDULE. This is why a "web app" is not a good choice for a "scheduled task".
 
Share this answer
 
Comments
Zerotimedev 2-Oct-14 21:07pm    
so i should just not use these packages like hangfire etc... and run as a sceduled console app or even a windows service instead?

thats what i was originally thinking but thought i might investigate these other solutions.
Zerotimedev 2-Oct-14 21:30pm    
i was trying to work out ways to make deployment easier basically, i dont think hosted servers will really allow for a batch file or windows service to run on their end. Any other ideas?
Dave Kreskowiak 2-Oct-14 23:10pm    
Console app that runs from Windows Scheduled Tasks.
Zerotimedev 2-Oct-14 23:28pm    
cheers ill stick with the console app thanks
Member 10754595 17-Jul-17 10:53am    
I have code which sends email notification if a document is uploaded to view. Now I want to send a reminder to those people who have not seen the document yet.
Can anyone help with a code please?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900