Running script issue

I'm on 8.1.22

I have an issue with the number of running scripts, that issue load gateway memory and crash the gateway.

I have a script to load a repreater, problem I got is that the function to load it is longer than the event that is fire it and each event add a running script.

Is there a way to protect an already running script to not be fired again?

You can achieve a very rudimentary exclusive lock with a pattern like:

  • Check a sentinel value in a session prop as soon as the script starts. If it's set, immediately abort execution.
  • If it's not set, immediately write it and then kick off your expensive/slow processing.
  • Once your processing is done, unset the flag. Make sure that this process happens whether any exception is thrown in your processing code, or you'll end up locked out from events entirely.

There are many more robust options available, but that should work fine for a simple event overrun.

1 Like

I did something similar.

Is there a way to retreive project or view from a threadID ?