我每天都面临这个问题。我有一个应用程序,它通过cfhhtp
调用/请求在夜间计划作业中捕获来自各种应用程序的大量数据。这里的问题是它调用“广泛的范围列表”来捕获数据,不幸的是我们无法限制范围:(任务中设置的超时时间是 9000 秒(已经相当高),但它仍然说超时在cfhttp
标签
“请求已超过允许的时间限制标签: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>
不:该页面有一个“包含”,从它捕获范围的地方。