Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Long running process detected

Is there a way to give the API more time to process before it spits out this error? I have a script that sometimes requires more than two status effects to be removed from a target at the same time. I always encounter this error (and it is not an infinite loop) If the target has only one or two status effects that need to be changed then it seems okay.
I just found the setInterval Function and it seems to work by creating a small delay on each process. yay!
How many status effects are you removing and receiving this error with? The server gives your script about 6 seconds to respond before killing it.
This is so random... sometimes it works and other times it does not. I have even used the setTimeout function to space each process (this seems to make a difference but it does not always work). Is it possible to add a few seconds before it kills the script?
I guess my point was -- 6 seconds is a LONG time in the world of computing. Like, most things you do should take less than 1 second (even looping through thousands of items). And "setting" things is pretty much instant as well. Are you sure there really isn't an infinite loop getting caused? Or that you aren't using nested looping in a way that's bad? (E.g. loop though a list, for every item in that list loop through a list, for ever item in that list loop through a list...)
I must be nested looping (in a way that is bad) because sometimes it works. (it is definitely not infinite) The strange thing is that it seems to work when I place a setTimeout function on the process. (with a 1 second delay).