[英]How should I run long-running or recurring taks in a self-hosted .net core mvc application?
What is the best practice for running additional continuous tasks(eg a timer) in .net core mvc application (since there is no Application_start
event). 在.net核心mvc应用程序中运行其他连续任务(例如计时器)的最佳实践是什么(因为没有
Application_start
事件)。 Should i place it in the Main
method or somewhere else? 我应该将其放置在
Main
方法中还是其他地方?
It's a self-hosted app. 这是一个自托管的应用程序。
I would create it a separate Console App and schedule a window task using Task Scheduler to execute this app as needed, this is the case if you are deploying in a VM, if you are deploying to Azure, then it will be a Web Job. 我将创建一个单独的控制台应用程序,并使用任务计划程序计划一个窗口任务以根据需要执行该应用程序,如果要在VM中进行部署,如果要部署到Azure,则将是Web Job。
I will do my best to keep away any long running processes from MVC 我将尽我所能避免任何长期运行的MVC进程
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.