Jump to content
Sign in to follow this  
kelliott

Contribution :Suspend script if too many are active

Recommended Posts

Suspend script if too many are active

View File

This script is used to suspend any other scripts that may be running by the same name if too many of it are active on the same client at once. This has the practical effect of sleeping a script, recording it's place in line and checking again in 30 seconds to validate if it's time to try again. 

 

To use it, set a variable in your script of MaxRuns to however many you want to run at a time, add a 15 second sleep step then use the script run function to call it. This allows it to effectively build the queue and then process them as they come in. Once it's time for that one to resume, it will return to your source script and continue. 

 

Special thanks to @danialbulloch, who without his help this script would have not happened. He was both the inspiration and the source of the SQL query that makes it all work


 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×