gpt4 book ai didi

coldfusion - 请求已超过允许的时间限制标记 : cfhttp

转载 作者:行者123 更新时间:2023-12-04 01:36:24 25 4
gpt4 key购买 nike

我每天都面临这个问题。我有一个应用程序,它通过 cfhhtp 从夜间调度作业中的各种应用程序中捕获大量数据。调用/请求。
这里的问题是它调用“广泛的范围列表”来捕获数据,不幸的是我们无法限制范围:(
任务中设置的超时时间为 9000 秒(这已经相当高了),但它仍然在 cfhttp 显示超时。标签

"The request has exceeded the allowable time limit 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>

不是:页面有一个“包含”,从它捕获范围的地方。

最佳答案

在页面顶部,添加以下 cfsetting代码,为 requestTimeOut 分配足够大的值.这明确地设置了整个页面的超时时间,只要它们的累积执行时间总计不超过此值,就允许任何标记根据需要花费时间。

<cfsetting requestTimeOut = "9000" />

关于coldfusion - 请求已超过允许的时间限制标记 : cfhttp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22501115/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com