The request has exceeded the allowable time limit Tag: cfhttp

你。 提交于 2019-12-12 11:09:25

问题


I am facing this issue on a daily basis. I am having an application which Catches the huge data from various applications in the nightly schedule jobs through a cfhhtp call/request. The problem here is that it calls the 'extensive list of scopes' to catch the data, and unfortunately we cannot limit the scopes :( The timeout set in the Task is 9000 seconds(which already is quite high), but still it says timeout at cfhttp tag

"The request has exceeded the allowable time limit Tag: cfhttp".

I don't know how cfhttp works, but there should be some solution that if it catches data for some long time and from various scopes, it should not throw error and continues to work till the last request.

<cfset dynVarName = "funded" & bizforShort>
<cfif structKeyExists(variables,dynVarName)>
    <cfset howManyCustomScopes = listLen(structkeylist(variables[dynVarName],"|" ),"|" )>
    <cfmodule template="#Request.Library.CustomTags.VirtualPath#Scheduler_LogDetail.cfm"
                  Step="Funded Level Cache" Detail="Custom Scopes to be cached: #howManyCustomScopes#"
                  LogData=""></cfmodule>
    <cfloop collection="#variables[dynVarName]#" item="t">
        <cfset tempurl = variables[dynVarName][t]["url"]>
        <cfset tempurl = tempurl & "&retainCache=1">
        <cfoutput>
            <cfhttp url="#tempurl#" method="GET" resolveurl="false" timeout="9000">
            #tempurl#<br>
            <cfset scopesCachedCounter = scopesCachedCounter + 1>
            <cfmodule template="#Request.Library.CustomTags.VirtualPath#Scheduler_LogDetail.cfm" Step="Funded Scopes Cache" Detail="#scopesCachedCounter#.- #t#" LogData="#tempurl#"></cfmodule>
        </cfoutput>
    </cfloop>
</cfif>

Not: The page has one 'include' from where it catches the scope.


回答1:


At the top of the page, add the following cfsetting code, assigning a large enough value to requestTimeOut. This definitively sets the time out for the entire page, allowing any tags to take as long as they need as long as their cumulative execution time doesn't total more than this value.

<cfsetting requestTimeOut = "9000" />


来源:https://stackoverflow.com/questions/22501115/the-request-has-exceeded-the-allowable-time-limit-tag-cfhttp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!