I have a loop that calls a cfcomponent object.
<cfset queue_list = "1,2,3">
<cfloop list="#queue_list#" index="z">
<cfset args = StructNew()>
<cfset args.group_num = z>
<cfset args.client_id = 1>
<cfset processdownloads = downloader.ProcessDownload(argumentCollection=args)>
</cfloop>
The component has the following function:
<cffunction name="ProcessDownload" access="public" output="false">
<cfargument name="group_num" type="numeric" required="yes">
<cfargument name="client_id" type="numeric" required="yes">
<cfset variables = arguments>
<cfthread action="RUN" name="download_#variables.client_id#_#variables.group_num#" priority="high">
<cffile action="WRITE" file="#expandpath('download\download_in_process\')##variables.group_num#.json" output="#variables.group_num#">
</cfthread>
</cffunction>
When I run it I receive the following error:
Attribute validation error for the cfthread tag. Thread with name DOWNLOAD_4003_3 could not be created. Thread names must be unique within a page.
The error occurred on line 29.
I have no idea why but it seems to be running twice. Should it not be generating a new thread with a unique thread name, thus avoiding the tread name conflict?