Hi,
I ran a groovy script in script console that was updating jira issues around 1500 and it gave me timeout error on the page of script console but i observed that the script was running in the background doing its work!. My Questions are,
BR
Sheeraz
Hi Sheeraz,
Regarding your first question I am not sure that you can dynamically set the page time out within ScriptRunner.
For your second question a solution would be to have some type of timer. In code this should be something like
def startTime = System.currentTimeMillis()
def endTime = 5000 // in milliseconds, so 5000 ms = 5 sec
//infinite loop
while (true) {
log.debug "I am running ..."
// od something
if (System.currentTimeMillis() - startTime > endTime) {
log.debug "TIme passed I will end it now"
return
}
}
But before you go with a solution like this, you have to think a bit more about the consequences, for example if there is an infinite loop somewhere then is better to find this out and fix it, the timer will just cover the issue.
Also lets say in your scenario that your script updates thousands of issues and then after some time it stops, because of the timer. Then how do you know which issues got updated and which not (maybe with some logging), but my point is that the actions of a scriptshould be clear. Under which conditions should run, what is the expected result and when it ends.
Hopefully you see my point.
Kind regards, Thanos
Hi Thanos,
Thanks for your reply and yes i can see your point here that script should be clear and well handled to cover up all the scenarios and should not trigger the infinite loop in the first place. My concerns were about the environment in which we are running a script, here in our case is script console that there should be some kind of interrupt button/signal or something to halt the execution of the script to avoid triggering any cases where the only available option seems to be the jira service restart even disabling the plugin doesn't seem to work.
BR
Sheeraz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.