Created
July 4, 2011 12:33
-
-
Save ciaranarcher/1063287 to your computer and use it in GitHub Desktop.
ColdFusion Timeout Experiment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent output="false"> | |
<cfset this.name = "testApp" /> | |
<cfset this.clientManagement = false /> | |
<cfset this.sessionManagement = false /> | |
<cffunction name="onError" access="public" returntype="void" output="false" hint=""> | |
<cfargument name="err" type="any" required="true" /> | |
<cflog log="application" type="error" text="onError() called in '#this.name#' application: #ARGUMENTS.err.message#" /> | |
</cffunction> | |
</cfcomponent> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
**************************************************************************************** | |
Set a two second max request time for this page - ensure that in CF admin you have the | |
Timeout Requests after (x seconds) setting ticked! Otherwise NO timeout values will be | |
checked! | |
**************************************************************************************** | |
---> | |
<!--- ---> | |
<cfsetting requesttimeout="2" /> | |
<!--- Get a timer ---> | |
<cfset x = getTickCount() /> | |
<cfloop from="1" to="5" index="i"> | |
<cfset sleep(1000) /> <!--- Sleep the request thread for a second ---> | |
<cfoutput><p>Ran for #getTickCount() - x# ms...</p></cfoutput> | |
<!--- Making a cfhttp call will result in the timeout value being checked, which in this case will cause an exception ---> | |
<cfhttp url="http://google.com" /> | |
</cfloop> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment