Hi.
I have a problem with a long running thread want to be able to terminate while its running.
The task uses cfthread to re-schedule it self after performing n number of sub-tasks and can be running for days.
This part works well, but hen trying to terminate the thread from another script i get this error:
there is no thread running with the name [longrunning_thread] at lucee.runtime.tag.ThreadTag.doTerminate(...
To reproduce this error, consider these two scripts:
script 1:
<! this script is running 30 times during a period of 30s ->
<cfparam name="request.count" default="0">
<cfthread name="longrunning_thread" action="run">
<cfscript>
sleep(1000);
request.count++;
</cfscript>
<cfif request.count LT 30>
<cfhttp url="[url]/thread.cfm?count=#request.count#" redirect="yes" resolveurl="no" throwonerror="yes" timeout="3600" />
</cfif>
</cfthread>
script 2:
<! should terminate the running thread ->
<cfthread name="longrunning_thread" action="terminate" />
Is this a bug or am I doing something wrong?