views:

47

answers:

3

How should I add a cfschedule task to an app using the Coldbox framework?

Should I:

a.) write an event that does what the task, and point cfschedule to that URL with Coldbox?

b.) write a simple .cfm outside of coldbox?

Is one better than the other?

Thanks.

+1  A: 

I chose to use ColdBox event instead, so I can take advantage of using ioc plugin without accessing ColdSpring directly from the application scope.

Henry
+2  A: 

I agree, choose A, it gives you the entire lifecycle, access to logging, ses, etc.

Luis Majano
A: 

I think it really depends on how closely aligned the scheduled task is with your core functions.

If ColdBox will allow you to re-use parts of the site already running, or if it will provide better protection against change problems later, by all means use it. This is probably the correct answer 90% of the time.

However, if you want to do something tangentially related, like email and archive your IIS/Apache logs, then I don't think it makes sense to integrate the two.

Ben Doom