I'm running a cfschedule at "daily" intervals, but is there anyway to get it to execute at random hours not every 24th hour from when i initially set it to run?
So say I set it daily, how can I get it execute on a random hour in the day as opposed to every 24th day?
The same applies for monthly, how can I get it execute on a random day monthly as opposed to every 30th day?
my code now:
<cfschedule action = "update" task = "sendit" operation = "HTTPRequest" url = "http://xyz.com/xyz/xyz.cfm" startDate = "#DateFormat(now(),'mmmm, dd, yyyy')#" startTime = "#TIMEFORMAT(now(),'hh:mm:ss')#" interval = "daily" resolveURL = "Yes" requestTimeOut = "600">
Run the job at the start of the day/month. However, amend the file being run to sleep for a random period of time.
Wouldnt that skip it from executing if the schedule executes when the page is sleeping?
Or will it just subtract the sleeping seconds?
Also is this how you put a page to sleep,
<cfset thread = CreateObject("java", "java.lang.Thread")><cfflush> <cfset thread.sleep(5000)>
Also to get this to work so that its a random time daily, wouldn't I have to set the schedule to run for a certain amount of seconds as opposed to daily...