Note that there are some explanatory texts on larger screens.

plurals
  1. POCFTHREAD CFHTTP timeout
    text
    copied!<p>Basically I have a job scheduling engine that executes cfhttp calls from within a cfthread tag. This is so multiple jobs can run concurrently. Basically what I want to be able to do is extend the timeout period beyond what the administrator's default is on some of my cfhttp calls so that I can let them finish and get the results from the page I'm calling. But that's not happening. </p> <p>My CF Admin Request Timeout setting is 30 seconds. I have two files. The first is called 'MyThreadedCFHTTP.cfm':</p> <pre><code>&lt;cfthread action="run" name="job_#CreateUUID()#"&gt; &lt;cfsetting requesttimeout="400" &gt; &lt;cflog text="Web Service Request: Starting" file="JobSchedulerTest" &gt; &lt;!--- Lets do our cfhttp call ---&gt; &lt;cfset var httpResults = ""/&gt; &lt;cfhttp method="get" url="http://localhost:8500/sessiontesting/CFHTTPRequestTimeOut/GetResults.cfm?RequestTime=400" result="httpResults" timeout="400"&gt; &lt;cflog text="Web Service Result: #httpResults.FileContent#" file="JobSchedulerTest" &gt; &lt;/cfthread&gt;**strong text** </code></pre> <p>My cfm file that is called is 'GetResults.cfm'. It just sleeps for 59 seconds before doing anything.</p> <pre><code>&lt;cfsetting requesttimeout="400"/&gt; &lt;cfset sleep(59000)/&gt; </code></pre> <p>This doesn't work as expected. The cfhttp call, though it has has timeout of 400 seconds and I have a cfsetting/requesttimeout value right before it, will abort after 30 seconds with a Connection Timeout message. This is the servers default setting. Now whats interesting is if you remove the tags, the call will finish successfully. </p> <p>I'm assuming this has something to do when the cfhttp call is threaded its executing within some completely new context and so it can only see the administrator's request timeout value. But I'm just guessing. </p> <p>Can someone help me figure a solution here. I could remove the timeout value from the administrator, but I really hate to have to do that as I could would much prefer to keep that and only override it when I explicitly say so.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload