variables.rc
will not be copied into the thread unless you add it as an argument. Add rc
as an argument and then instead of variables.rc
you'll access it via arguments.rc
<cfthread name="threadA" action="run" rc="#variables.rc#">
<cftry>
<cfquery>
INSERT INTO dbo.Traffic (Circuit, Fuseaction, IP_hash)
VALUES (<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#listfirst(arguments.rc.fuseaction, '.')#">,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#listlast(arguments.rc.fuseaction, '.')#">,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#cgi.remote_addr#">
)
</cfquery>
<cfcatch />
</cftry>
</cfthread>
If that doesn't work you'll have to remove the try
/catch
and dump out your cfthread to see the error. The code below will output 'Variable C is undefined'
<cfthread name="threadA" action="run">
<cfset b = c>
</cfthread>
<cfdump var="#cfthread#"><cfabort>