Scheduled Tasks are Running Late


(BradleyBeer) #1

I am writing an app called Grandfather Clock. Basically, I am creating a digital Grandfather clock. Every 15 min, the app plays a chime via Sonos speakers. I have been able to adopt some of the example code to get the app working, however, one issue seems to keep popping up. I have the app scheduled to go of at :00 :15 :30 :45 during the hour, however, consistently the app doesn’t run on time. It usually is anywhere from 2-4 min late. Any thoughts?

Here is a copy of my expression that I used to schedule the app:

def scheduleEvents() {
    schedule("0 0 7-22 * * ?", scheduledOnHourHandler)
    schedule("0 15 7-22 * * ?", scheduledOnQuarterHourHandler)
    schedule("0 30 7-22 * * ?", scheduledOnHalfHourHandler)
    schedule("0 45 7-22 * * ?", scheduledOnThirdQuarterHourHandler)
}

(Engelwood) #2

You ever have any luck figuring this out? If so would you be willing to post your code? Seems like a neat idea.