Stop and then re-start the CF Service.

This is a bug listed on the MM site.

>>> [EMAIL PROTECTED] 24/03/2004 12:27:58 pm >>>
Hey Folks,

Found a really nasty bug when trying to get a recurring scheduled
process
to delete itself. It STILL HAPPENS on CFMX6.1, so it's not the delete
schedule bug that was reported in 6.0.

When you run the code below, the schedule is deleted from neo-cron.xml
after the first call and you can't see it when you list the scheduled
tasks with factory services. But that doesn't stop it and it's
impossible
to kill programatically. You have to restart the CF services.

I've tried - recreating the task in the past, deleting via <cfschedule
action="delete">, deleting via
factory services and altering the neo-cron.xml file directly. None of
this
works. In fact, the task isn't even listed in the xml file.

Any ideas?

Tim

Code - (save page as testschedule.cfm. Alter path in cfschedule as
necessary)

<cfif isDefined("url.test")>
        <!--- Should write one line to testschedule.txt when called by
scheduler and then delete the task. However it KEEPS RUNNING!! --->
        <cffile action="append" file="C:\temp\testschedule.txt"
output="Time: #now()#">
        <cfschedule action="delete" task="testschedule">
<cfelseif isDefined("url.start")>
        <!--- Create schedule to run every minute, starting a minute
from now --->
        <cfschedule
        action="update"
        task="testschedule"
        URL="http://<your path>/testschedule.cfm?test=1"
        interval="60"
        operation="httprequest"
        StartDate="#DateFormat(Now(),"yyyy-mm-dd")#"
        StartTime="#TimeFormat(DateAdd("n",1,Now()),"HH:mm")#"
        publish="no">
<cfelse>
        <!--- List all scheduled tasks --->
        <cfobject action="CREATE" type="JAVA"
class="coldfusion.server.ServiceFactory" name="factory">
        <cfdump var="#factory.CronService.listAll()#">
</cfif>

---
You are currently subscribed to cfaussie as:
[EMAIL PROTECTED] 
To unsubscribe send a blank email to
[EMAIL PROTECTED] 

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to