Jump to content

Suppressing the "Script is taking longer than expected" message


Recommended Posts

Is there a way to suppress or tame the "Script execution is taking longer than expected" message box? What is the criterion for this expectation?

Some of my scripts take sort of a long time to run, though not really "longer than expected". More often than not, WAsP brings up a "Script is taking longer than expected. End / Continue" message box, sometimes multiple times during script execution.

This box pops up on top of other applications, which is a minor annoyance. Also, the keyboard shortcut for the "End" option is "E", which I've accidentally pressed a few times, meaning the script was terminated and I had to restart it from scratch.

Any tips are appreciated!

Jean-François
Link to comment
Perhaps a quick and dirty solution would be to change the default button to Continue (instead of End) and remove the keyboard shortcuts, if this is at all possible. This would greatly reduce the likelihood of accidentally ending a script when the message pops up while typing in another application.

Right now "End" is triggered upon typing "e", space, or return, which are all quite frequent keystrokes. If the changes above could be implemented, then no single keystroke could end the script (though still certain combinations such as left arrow + space, but these are a couple of orders of magnitude less frequent).
Link to comment
The message which appears is part of Windows, and is not under our control. But we can adjust this timeout setting.

I have checked the code and it's set to 60 seconds. Of course the script might take longer to execute, but this is how long the scripting engine will wait when it thinks the script is hanging.

You are the first person to experience this as far as I know, but most people are not doing what you're trying to do.

Perhaps the best thing is simply to remove the timeout completely. This means that if the script hangs, then the whole WAsP session will need to be killed off, losing any unsaved work. We can put that change into the next WAsP 10 release (10.1).
Link to comment
A user-defined timeout would definitely be a step forward.

When I want to stop a script, I just press "Cancel" on whichever progress box is currently showing. What exactly is the use of the timeout? Is it for cases when one accidentally programmed e.g. an infinite loop? (e.g. Do Until False = True : Loop)
Link to comment
  • 3 years later...
Hello. I'm sorry to report that this feature request got "lost in the long grass" while we worked on the CFD integration for WAsP 11. I found it assigned to a future milestone. Now it's been moved up to the next release.

If you're ever "constantly running into an annoyance", please keep on telling us! We have many items on our radar, and sometimes they can be accidentally dropped like this.

Apologies again.

Duncan.
Link to comment
Hi Duncan, sorry, I didn't mean to put you on the spot! Here's me asking again.

We've resorted to having a Msgbox warn the user prior to running the script that they may see these "Script execution is taking longer than expected" messages, so they don't worry unduly and keep their guard up against accidentally pressing a keyboard shortcut for "End".
Link to comment
Unfortunately, my problem with this is more than a mild annoyance, as my script is supposed to run overnight, and the message eventually crashes the script. Is there any workaround to this problem (even if it would take considerably longer to run)? What exactly does the timer count (it's obviously not counting time from the start of the script run)? Is it idle time, processor use?
Thank you for the speedy response!
Link to comment
Avnerfurshpan, I have emailed you directly from waspsupport to ask you more about your case.

I think that for the script timeout to arise, you need to have invoked a single (atomic) operation which takes a long time. The script might take a long time to run if it does many operations, and no problem will arise. The error is caused by a single operation taking a long time.

I'm interested in what kind of operation you're running that takes so long to complete. Is it a big wake calculation, or a resource grid? How big are your maps?

Duncan
Link to comment
  • 5 months later...
Hi guys,

just letting you know we now have a build of WAsP that supports the timeout attribute in the script header! If anyone would be interested in testing this feature please let me know via email and we will get a special build out to you.

Cheers,
Ray
Link to comment
  • 8 months later...
Thanks for integrating this into Wasp, from the changelog I take it that this has already been included in build 58 of Wasp11.2.
Nevertheless I still don't know _how_ to activate the timeout settings. Has this been documented somewhere? What exctly needs to be written in the script header to set (or completely deactivate?) the timer?
BTW: Has there been any update of the Rvea_scripting.chm help file? The version I have dates back to 2011...
Thanks!
Link to comment
Anyone?...

I would be really greatful if someone could point me to the correct way of implementing that setting. We currently have a couple of calculations with large wind farms that frequently run into that problem and it would really ease our life if this message could be suppressed.

Thanks for any reply.
Link to comment
Ray wrote this:

The Timeout attribute allows the user to override the internal scripting timeout used by WAsP whenever a script is run.

The Timeout value is specified in seconds. A default timeout value of 60 seconds will be used if the attribute is not specified.

The Timeout attribute is only read when WAsP is started. This means that if you edit the attribute while WAsP is running you will need to restart WAsP before the change takes effect.
Link to comment
Hi, there is no special value to disable the timeout completely. To avoid your script getting interrupted you can just set the value to something far greater than you might expect the script to run. For example 100000 will give you just over a day before the dialog appears. The upper limit is 2147483647 (68 years!).

Cheers,
Ray
Link to comment

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
×
×
  • Create New...