应用程序超时时如何重新启动Coldfusion Application Server? [英] How to restart Coldfusion Application Server when application times out?
问题描述
当应用程序超时时,是否可以通过Application.cfc重新启动CF服务器?根据Adobe文档,它们显示如下:
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>
我想做的是用<cfexecute>
替换上面的<cflog>
,如下所示:
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 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屋!