If I have a scheduled script that I want to execute on a queue-custom record that is constantly added to.
What approach would you take to schedule/reschedule itself?
1. Have one deployment that is scheduled every 15 minutes and no rescheduling at the end of the execution.
2. Have two deployments, one that is scheduled every 15 minutes and one that is not scheduled. The first one starts the second one if the governance runs out or if there are new records to process when the execution is complete. The second one will then resubmit itself until there are no more records to process. I suspect that the next scheduled deployment could potentially start at the same time as the not scheduled one is still running.
3. Have one deployment that is not scheduled and let a UE-script on the queue-record try to ScheduledScriptTask.submit() on create. Then the schedule script could reschedule itself at the end and no other deployments could cause a conflict.
4. The help on
MapReduceScriptTask.submit() doesn't state the same limitation on scheduled/not scheduled. Perhaps I should re-factor it into a M/R and only have a scheduled deployment that reschedules itself?
• According to the documentation, you can't programmatically start a scheduled script instantly unless the deployment is set to "Not Scheduled". If it is set to "Scheduled", it will just queue it based on the schedule.
• I don't want to run the risk of two deployments of the same script executing simultaneously and thereby run the risk of processing the same queue record at the same time.