问题描述
我每天都面对这个问题。我有一个应用程序,通过 cfhhtp
调用/请求,捕捉每天日程安排作业中各种应用程序的巨大数据。
这里的问题是,它调用扩展范围列表来捕获数据,不幸的是我们不能限制范围:(
在任务中设置的超时是9000秒(已经是相当高),但仍然在 cfhttp
标记超时
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
我不知道 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>
不是:页面有一个include
Not: The page has one 'include' from where it catches the scope.
推荐答案
在页面顶部,添加以下代码,为 requestTimeOut
。这将明确地设置整个页面的超时,只要它们的累积执行时间总计不超过这个值,任何标签都可以使用任意长度。
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" />
这篇关于该请求已超过允许的时间限制标签:cfhttp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!