从WebJob内停止网站 [英] Stopping Website from within a WebJob

查看:163
本文介绍了从WebJob内停止网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有从WebJob停止了Azure的网站的任何方式?

Is there any way of stopping an Azure website from a WebJob?

我必须使用节点上运行的鬼Azure的网站。我试图安排在理想情况下应该在该网站不运行进行鬼数据库文件的备份。我可以用捻PowerShell控制台终止Node.exe进程暂时停止该网站。

I have an Azure Website using Ghost that runs on Node. I'm trying to schedule a backup of the Ghost database file which ideally should be done while the site is not running. I can stop the site temporarily by terminating the Node.exe process using the Kudu PowerShell console.

如果我尝试做从WebJob同样的事情,过程中不被终止 - 因为WebJob在不同的上下文中运行,并没有看到node.exe过程presumably

If I try to do the same thing from a WebJob, the process does not get terminated - presumably because the WebJob is running in a different context and doesn't see the node.exe process.

有没有停止/ A WebJob内启动一个网站的任何方式?

Is there any way of stopping/starting a site from within a WebJob?

推荐答案

其实好像我做错了什么,我WebJob当我最初试图终止 node.exe 过程。

Actually it seems I was doing something wrong in my WebJob when I was originally trying to terminate the node.exe process.

虽然@trailmax是正确的在终止网站(即w3wp进程)也将停止WebJobs(乃至捻网站),你可以终止 node.exe 从webjob。它会尽快另一个连接到现场做重新启动,所以它不是最好的解决办法遗憾的是 - 除非某种异步进程开始不断检查并终止 node.exe 直到WebJob完成其工作。

While @trailmax is correct in that terminating the site (i.e. the w3wp process) will also stop the WebJobs (and indeed the Kudu site), you can terminate node.exe from a webjob. It will restart as soon as another connection is made to the site, so it's not the best solution unfortunately - unless some kind of async process is started to continually check for and terminate node.exe until the WebJob has finished its work.

这篇关于从WebJob内停止网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆