Advice on reoccurring checks with status emails

Hi all,

I am after some advice on the best way to setup some user configurable, reoccurring check processes.

I have some data that i would like to regularly check to see if certain conditions have been met before reporting success or failure via email.

after the success email i’d like to end the process. but if success is not obtained then just keep sending failure emails, giving up late in the evenings if success status has not been obtained.

I tried to set this up using a recurring job with an appropriate Cron schedule that gets fired once a day in the morning. (this much seems to work okay).

the recurring job calls a method that was supposed to loop/sleep checking the condition and reporting on the outcome until it succeeds or gives up.

Unfortunately the reoccurring task is not working at all how i expected it to. Also the check inside my loop condition appears to be running every few milliseconds rather than every hour or so.

I would really appreciate some advice on how to set this scenario up properly as what i am doing right now is obviously wrong.

Thanks!

You can try another approach.

Create scheduled daily tasks at different hours. Create an external setting with success flag.

Ex:
Recurring tasks at 9am, 10 am … 4pm. They all check the external setting to process if not processed and then send email if necessary.