cfthread

cfhttp in cfloop limit? use cfthread

风格不统一 提交于 2019-12-12 05:11:55
问题 I'm currently trying to develop an API and the stage where I'm at just now is to populate a table with a full data set (ID, first name, last name, dob etc). The way I've written this is to use a cfloop from 1 to 500,000 (as I don't know what range the IDs range from and to) and within each cfloop I call a function that makes a cfhttp request to the server and retrieve the content. I then deserialize the returned JSON, call a function to query my table to see if the current item ID already

coldfusion (railo) and cfthread not working as I would expect

我与影子孤独终老i 提交于 2019-12-11 01:03:25
问题 I've not used cfthread before but i'm using the following code and it's not working. <cfloop from="1" to="5" index="local.pageNo"> <cfthread name="thr#local.pageNo#" threadIndex="#local.pageNo#" action="run"> <cfif local.pageNo GT 1> <cfhttp url="#local.apiURL#&page=#local.pageNo#" method="get" result="local.myResults" > </cfhttp> <cfset local.myResponse = deserializejson(local.myResults.filecontent)> </cfif> <cfloop from="1" to="#arrayLen(local.myResponse.result)#" index="i"> <cfset local