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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...