Time taken to set a global variable?

Hi all,

I have a change node which sets a global variable, the message then goes on to a function which reads that variable. It seems that the message gets to the function before the variable is set. i.e. the new value isn't there when I read it. If I add a 1sec delay node in between then all is fine.

Does this seem like expected behaviour ?

Running on a pi4 what might be a more realistic minimum time to allow before passing on the message to the function node ?

The Change node doesn't pass the message on until the call to set the value in context has returned - so the Function node should see the value set by the Change node without a delay.

Can you share a simple flow that demonstrates the issue?

Thanks - so if it's not normal then I will investigate some more.

So I found that my function was running ok but actually its too fast for my browser to see the dynamic changes it makes. These must happen before the page loads so I see the defaults. The delay node allows the page to load and then the function updates the page correctly.

Thanks for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.