Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheduled Tasks for Web Applications

What are the different approaches for creating scheduled tasks for web applications, with or without a separate web/desktop application?

like image 662
Krishna Kumar Avatar asked Dec 02 '22 09:12

Krishna Kumar


2 Answers

If we're talking Microsoft platform, then I'd always develop a separate Windows Service to handle such batch tasks.

You can always reference the same assemblies that are being used by your web application to avoid any nasty code duplication.

like image 193
Ian Nelson Avatar answered Mar 20 '23 22:03

Ian Nelson


Jeff discussed this on the Stack Overflow blog - https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/

Basically, Jeff proposed using the CacheItemRemovedCallback as a timer for calling certain tasks.

I personally believe that automated tasks should be handled as a service, a Windows scheduled task, or a job in SQL Server.

Under Linux, checkout cron.

like image 25
Seibar Avatar answered Mar 20 '23 23:03

Seibar