应用程序超时如何重启 Coldfusion Application Server? [英] How to restart Coldfusion Application Server when application times out?

查看:20
本文介绍了应用程序超时如何重启 Coldfusion Application Server?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当应用程序超时时,有什么方法可以通过Application.cfc 重新启动CF 服务器?根据 Adob​​e 文档,它们显示如下:

Is there any way to restart the CF server through the Application.cfc, when the application times out? As per Adobe documentation, they showed as follows:

<cffunction name="onApplicationEnd">
    <cfargument name="ApplicationScope" required=true/>
    <cflog file="#This.Name#" type="Information" 
        text="Application #Arguments.ApplicationScope.applicationname# Ended" >
</cffunction>

我想做的是将上面的 <cflog> 替换为 <cfexecute> 如下:

What I would like to do is replace the <cflog> above with <cfexecute> as follows:

<cfexecute name = "C:CFRestart.bat"
    outputFile = "C:output.txt"
    timeout = "1">
</cfexecute>

所以 OnApplicationEnd 将在应用程序超时时运行 CFRestart.bat 文件.这可能吗?

So OnApplicationEnd will run the CFRestart.bat file when the application times out. Is this possible or not?

推荐答案

onApplicationEnd is 不太可能到达,除非您有一个非常安静的应用程序,因为每次有人访问该应用程序时都会重置超时.

onApplicationEnd is not likely to be reached unless you have a very quiet application because every time someone access the application the timeout is reset.

如果使用应用程序重新启动 Coldfusion 实例,我会感到非常不舒服.我可以看到各种可怕的安全问题等迫在眉睫.老实说,如果您的应用程序结束,我不确定您为什么要重新启动服务器.

I'd be very uncomfortable using an application to restart a coldfusion instance. I can see all sorts of horrible security issues etc looming. To be honest I'm not really sure why you'd want to restart the server if your application end.

此外,根据文档 onApplicationEnd 在服务器重新启动时被调用,所以如果你确实让这个工作正常,当你重新启动服务器时,应用程序也会重新启动你的服务器.这会变得非常混乱.

Also, according to the docs onApplicationEnd is called when the server is restarted, so if you did get this working, when you restart your server the application would also have a go at restarting your server. This would get very messy.

这篇关于应用程序超时如何重启 Coldfusion Application Server?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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