Async action group - setting maxthreads via a JS Beforescript doesn't seem to work?

Hi Guys,
I have these lines in the BeforeAction script (JS) of my Async Action Group:

Action.MaxThreads = 3;
Action.ThreadStartDelay = 1;

The ThreadStartDelay part is working, it updates the async action group with this value for thread start delay and executes with the delay specified in the BeforeScript.
Alas, the MaxThreads part does not seem to work, I set it to 3 (for example) and I see it executes all the items in the async Group (holds more than 3 items of course).
I noticed the property is saved in the fbp8 json file as lowercase “maxthreads” so I tried
setting it using a lowercase notation (maxthreads instead of MaxThreads) but that doesn’t solve it.
If however, I set this value from UI (“Limit concurrent threads”) then it is working as expected and only 3 items in the async group are running simultaneously.
Please help me understand if I’m doing something incorrectly or if this is somehow a bug?

By the way, can ThreadStartDelay somehow be set to anything in milliseconds rather than seconds?

FB Version

Hi Arik

You also need to set the LimitThreads property.

Action.MaxThreads = 2;
Action.LimitThreads = true;

We’ll need to do some work to enable that and maintain backwards compatibility. It’s on the list for FB9 but I’ll see if we can get it done sooner.

1 Like