I am having a problem where the script manager doesnt seem to be initializing properly sometimes which makes me think it might be a race condition in the startup of my module. At what point in the gateway starting lifecycle is this initializeScriptManager called?
After setup
, and then again any time as needed, e.g. modules stopped/started, gateway scripting project changing, whatever.
is that before startup
then or after that?
Setup >> Startup >> Shutdown
"After Setup" doesn't mean "After Startup". And it is called many times after that as you edit projects.
In practice I think it's between setup
and startup
the first time, then possible again any time after.
But the docs suggest the only guarantee you get is after setup
.
Ah I see, that might be my issue. I initialize my spring context in the startup
not in setup
. I wonder if after setup
is done I have startup
and initializeScriptManager
running at the same time and there being a race condition.
I've never seen anyone have much luck trying to embed Spring inside Ignition via a module.
haha, yeah its not easy but it does seem to be working now. I think it was the spring context not being initialized in time.