How the hell can I do this hour-plus process?

We e-mail broadcasts that have begun to choke our outgoing smtp server, so I need to send small groups at fixed intervals. 1 000 emails in batches of 100 every 10 minutes would take well over an hour which is good for sending, but NOT for the CF Server!

Obviously (to the right)? I can't have a process running this long on the server, so y at - it another way that having a task running every 10 minutes to check what was sent etc etc?

I tried incrementing counters and cflocating a page back to itself after a break with this code and it seems to work, but it's the best approach? :

< cfif not isDefined ("url.pass") >
< cfset url.pass = 1 >
< / cfif >
< cfset maxx = 4 >
< cfset pass = #url.pass # + 1 >
< cfset attributes.interval = 4 >
< cfscript >
thread = createObject ("java", "java.lang.Thread");
thread. Sleep (javaCast ("long", 1000 * attributes.interval));
< / cfscript >
< cfif #pass lt # #maxx # >
< cflocation url = "Untitled - 5.cfm? pass = #pass #">"
< / cfif >

Any comments would be greatly appreciated!

Thank you
Richard

cfchedule I had totally forgotten about it. Very cool. Can I schedule a task to run until it ends, then remove it when finished. Perfect.

Thank you!!

Tags: ColdFusion

Similar Questions

Maybe you are looking for