我每天都面临这个问题。我有一个应用程序,它通过夜间计划作业捕获来自各种应用程序的大量数据cfhhtp
打电话/请求。
这里的问题是它调用“广泛的范围列表”来捕获数据,不幸的是我们无法限制范围:(
任务中设置的超时时间是 9000 秒(这已经相当高了),但它仍然显示超时cfhttp
tag
“请求已超出允许的时间限制标签:cfhttp”。
我不知道怎么办cfhttp
有效,但应该有一些解决方案,如果它长时间捕获来自不同范围的数据,它不应该抛出错误并继续工作直到最后一个请求。
<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>
不是:该页面有一个“包含”,它从其中捕获范围。
在页面顶部添加以下内容cf设置 https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-r-s/cfsetting.html代码,分配一个足够大的值requestTimeOut
。这明确地设置了整个页面的超时,允许任何标签根据需要使用只要它们的累积执行时间不超过该值即可。
<cfsetting requestTimeOut = "9000" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)