If you flip this problem on its head, you could approach it like this....
If the engines are busy, they can't run queued jobs. So you could setup a schedule (one per engine) at 5am that runs a job with a decelerator that takes 30 mins. Set this to the highest priority so it runs before anything else in the queue Then the engines can't be used for other tasks.
In saying that, there are some risks I can see with the problem and my proposed solution
- What if a triggered (before 5am) job is running during the maintenance period - that could fail if a required resource is down
- In the same scenario, your scheduled task will then kick off during that window - could start at 5.25 and therefore finish at 5.55
- one way around this would be to dynamically set the run time of the decelerator based on when it starts. use a timestamper, calculate how long till 5.30, then use that time in the decelerator. If current time stamp > 5.30 set no delay
- This wouldn't stop someone setting a schedule to run during the outage, but would instead add it to the queue and run once the 'blocking' jobs are finished
If you flip this problem on its head, you could approach it like this....
If the engines are busy, they can't run queued jobs. So you could setup a schedule (one per engine) at 5am that runs a job with a decelerator that takes 30 mins. Set this to the highest priority so it runs before anything else in the queue Then the engines can't be used for other tasks.
In saying that, there are some risks I can see with the problem and my proposed solution
- What if a triggered (before 5am) job is running during the maintenance period - that could fail if a required resource is down
- In the same scenario, your scheduled task will then kick off during that window - could start at 5.25 and therefore finish at 5.55
- one way around this would be to dynamically set the run time of the decelerator based on when it starts. use a timestamper, calculate how long till 5.30, then use that time in the decelerator. If current time stamp > 5.30 set no delay
- This wouldn't stop someone setting a schedule to run during the outage, but would instead add it to the queue and run once the 'blocking' jobs are finished
potential solution to my first point
set an external (windows task scheduler) schedule to make a call to the rest api to remove all engines during the outage period, then reinstate them once the maintenance window is up